Need help reformatting...

Discussion in 'ASP .Net' started by TN Bella, Aug 9, 2004.

  1. TN Bella

    TN Bella Guest

    This may be a double post...
    I appreciate all the help I have gotten on here - thank you! So with
    that in mind, I figured I would try another post! :)

    I need to reformat the following information like this:

    txtacctnum txtcostcntr txtrefnum txtacctamt
    txtacctnum1 txtcostcntr1 txtrefnum1 txtacctamt1
    txtacctnum2 txtcostcntr2 txtrefnum2 txtacctamt2

    Currently it is like this:
    txtacctnum
    txtacctnum1
    txtacctnum2

    txtcostcntr
    txtcostcntr1
    txtcostcntr2







    Dim index As Integer

    litResponse.text += "<b>Account Number</b>: "
    & txtacctnum.Text.ToUpper & "<br>" 'First output for first "txtAcctNum"
    box then goes to loop
    For index = 1 To 14
    If CType(Me.FindControl("txtAcctNum" &
    index.ToString()), TextBox).Text <> "" Then 'Condition to check for null
    strings & to stop it from displaying.
    litResponse.Text += "<b>Account number " &
    index & " : </b>" & _
    CType(Me.FindControl("txtAcctNum" & index),
    TextBox).Text & "<br>"
    End If
    Next index
    litResponse.Text +="<br>"


    'The first txtCostCntr can be null if
    txtAcctNum = 9
    If txtCostCntr.Text<>"" Then
    litResponse.text += "<b>Cost Center</b>:
    " & txtCostCntr.Text.ToUpper & "<br>"
    Else
    litResponse.text += "<br>"
    End If


    For index = 1 To 14
    If CType(Me.FindControl("txtCostCntr" &
    index.ToString()), TextBox).Text <> "" Then 'Condition to check for null
    strings & to stop it from displaying.
    litResponse.Text += "<b>Cost center " &
    index & " : </b>" & _
    CType(Me.FindControl("txtCostCntr" & index),
    TextBox).Text & "<br>"
    End If
    Next index
    litResponse.Text +="<br>"

    'The first txtRefNum can be null
    If txtRefNum.Text<>"" Then
    litResponse.text += "<b>Reference
    Number</b>: " & txtRefNum.Text.ToUpper & "<br>"
    Else
    litResponse.text += "<br>"
    End If


    For index = 1 To 14
    If CType(Me.FindControl("txtRefNum" &
    index.ToString()), TextBox).Text <> "" Then 'Condition to check for null
    strings & to stop it from displaying.
    litResponse.Text += "<b>Reference Number "
    & index & " : </b>" & _
    CType(Me.FindControl("txtRefNum" & index),
    TextBox).Text & "<br>"
    End If
    Next index
    litResponse.Text +="<br>"

    'litResponse.text += "<b>Account Amount</b>: $"
    & txtAcctAmt.Text & "<br>" 'First output for first "txtAcctAmt" box then
    goes to loop
    Dim DollarText2 as double
    Dim TxtBoxVal as string

    DollarText2 = Convert.ToDouble(txtAcctAmt.Text)
    TxtBoxVal = DollarText2.ToString("C")

    'litResponse.text += "<b>Account Amount</b>:
    " & txtAcctAmt.Text & "<br>" 'First output for first "txtAcctAmt" box
    then goes for loop

    litResponse.text += "<b>Account Amount</b>:
    " & TxtBoxVal & "<br>" 'First output for first "txtAcctAmt" box then go
    for loop

    For index = 1 To 14
    If CType(Me.FindControl("txtAcctAmt" &
    index.ToString()), TextBox).Text <> "" Then 'Condition to check for null
    strings & to stop it from displaying.
    ''''''''''''''
    'code to display txtAcctAmt as Dollar
    amount

    TxtBoxVal =
    CType(Me.FindControl("txtAcctAmt" & index.ToString()), TextBox).Text

    if (len(TxtBoxVal) > 0) then
    DollarText2 =
    Convert.ToDouble(TxtBoxVal)
    TxtBoxVal = DollarText2.ToString("C")
    end if

    ''''''''''''
    litResponse.Text += "<b>Account Amount " &
    index & " : </b>" & TxtBoxVal & "<BR>"

    End If
    Next index
    litResponse.Text +="<br>"

    litResponse.text+="<b>Account Amount
    Total</b>: " & txtAcctAmtSum.text & "<br>"



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    TN Bella, Aug 9, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Curt
    Replies:
    3
    Views:
    1,856
    Sahil Malik
    Jun 18, 2004
  2. Chris Lane
    Replies:
    3
    Views:
    377
    Chris Lane
    Nov 17, 2003
  3. Lloyd Sheen

    Why the reformatting

    Lloyd Sheen, Nov 24, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    312
    Lloyd Sheen
    Nov 24, 2003
  4. Lloyd Sheen

    Brain Dead Reformatting

    Lloyd Sheen, Jan 24, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    327
    Lloyd Sheen
    Jan 24, 2004
  5. Dj Frenzy
    Replies:
    3
    Views:
    298
    Dj Frenzy
    Oct 16, 2003
Loading...

Share This Page