Results 1 to 6 of 6

Thread: Help me with Crystal Report....URGENT

  1. #1

    Thread Starter
    Lively Member preethi_rjs's Avatar
    Join Date
    Dec 2006
    Posts
    80

    Smile Help me with Crystal Report....URGENT

    hi,

    i used the following coding prior to report generation.

    VB Code:
    1. d.Execute ("delete from rep_prd")
    2. d.Execute ("delete from rep_others")
    3. d.Execute ("delete from rep_fandr")
    4. d.Execute ("delete from rep_vat")
    5.  
    6. Set rs1 = d.Execute("select no as invno from inv_mast where no between '" + Text2 + "' and '" + Text3 + "'")
    7.  
    8. If rs1.EOF Then
    9. MsgBox "No Invoice between the Specified Range", vbOKOnly + vbCritical, "Warning !!"
    10. Text1 = ""
    11. Text2 = ""
    12. Text3 = ""
    13. Text1.SetFocus
    14. Exit Sub
    15. Else
    16.  
    17. Set rs2 = d.Execute("select * from inv where no between '" + Text2 + "' and '" + Text3 + "' order by line")
    18.  
    19. Do While Not rs2.EOF
    20.  
    21.     MsgBox rs2!code, , "Code"
    22.    
    23.     If Len(rs2!code) = 8 Then
    24.         c1 = Mid(rs2!code, 1, 2)
    25.         Set rs4 = d.Execute("select des from glob where no='" + c1 + "'")
    26.         If Not rs4.EOF Then
    27.             d1 = rs4!des
    28.         End If
    29.         rs4.Close
    30.         c2 = Mid(rs2!code, 3)
    31.         Set rs3 = d.Execute("insert into rep_prd values('" + invno + "','" + c1 + "','" + d1 + "','" + c2 + "','" + rs2!des + "','" + rs2!qty + "','" + rs2!Rate + "','" + rs2!amt + "')")
    32.     End If
    33.    
    34.     If Len(rs2!code) = 2 And rs2!code <> 95 And rs2!code <> 99 And rs2!code <> 72 Then
    35.             c3 = rs2!code
    36.             Set rs4 = d.Execute("select des from glob where no='" + c3 + "'")
    37.             If Not rs4.EOF Then
    38.                 d2 = rs4!des + " ON  Rs." + rs2!qty + " @ " + rs2!Rate + "%"
    39.             End If
    40.             rs4.Close
    41.             Set rs3 = d.Execute("insert into rep_others values('" + invno + "','" + c3 + "','" + d2 + "'," + rs2!amt + ")")
    42.     End If
    43.    
    44.     If Len(rs2!code) = 2 And rs2!code = 72 Then
    45.         c3 = rs2!code
    46.         Set rs4 = d.Execute("select des from glob where no='" + c3 + "'")
    47.         If Not rs4.EOF Then
    48.             d2 = rs4!des + " ON  Rs." + rs2!qty + " @ " + rs2!Rate + "%"
    49.         End If
    50.         rs4.Close
    51.         Set rs3 = d.Execute("insert into rep_vat values('" + invno + "','" + c3 + "','" + d2 + "'," + rs2!amt + ")")
    52.     End If
    53.    
    54.     If Len(rs2!code) = 2 And rs2!code = 95 Or rs2!code = 99 Then
    55.         c3 = rs2!code
    56.         Set rs4 = d.Execute("select des from glob where no='" + c3 + "'")
    57.         If Not rs4.EOF Then
    58.             d2 = rs4!des
    59.         End If
    60.         rs4.Close
    61.         Set rs3 = d.Execute("insert into rep_fandr values('" + invno + "','" + c3 + "','" + d2 + "'," + rs2!amt + ")")
    62.     End If
    63.  
    64. rs2.MoveNext
    65. Loop
    66. End If
    67. 'Else
    68. 'MsgBox "No Products Sold"
    69. 'End If 'rs2 close
    70. 'End If 'rs1 close
    71.  
    72. inv.ReportFileName = App.Path & "\inv.rpt"
    73. inv.WindowState = crptMaximized
    74. inv.DiscardSavedData = 1
    75. inv.Action = 1

    there is no error in adding to the corresponding table.
    but while generating reports, i face some problems :

    1) invno is always retrieved as blank with no values stored in it.

    2)Now as i am giving both values Text2 and Text3 same, i am able to get the product list correctly. bt when i giv a range of values, hw shud i change the looping structure so that for each invoice(that i get thru range), i get reports separetly.

    3)in the table rep_others and rep_fandr, i will hav multiple fields. while adding to the table i hav added correctly, bt while displaying iam able to view only 1 row. y is it so? [NOTE:For rep_prd table i hav include subtotal field. so im unable to include it in the "Details" part.

    plz help me solve this...................
    Preethi.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help me with Crystal Report....URGENT

    First off, you are concantenating, not adding values, so you need to change the + signs to & signs.

  3. #3

    Thread Starter
    Lively Member preethi_rjs's Avatar
    Join Date
    Dec 2006
    Posts
    80

    Smile Re: Help me with Crystal Report....URGENT

    Thanx Hack for ur quick reply..............hav changd it.

    as i need some codes to be under the head "ADD" and others under "LESS" im making these table insertions and then generating reports.
    Preethi.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help me with Crystal Report....URGENT

    Did changing to the proper method of concantenation help with any of your other issues?

  5. #5

    Thread Starter
    Lively Member preethi_rjs's Avatar
    Join Date
    Dec 2006
    Posts
    80

    Smile Re: Help me with Crystal Report....URGENT

    i got the value for invno. i dint specify recordset name.

    then,i am able to save correctly to tables. bt while generating Reports i hav doubts.

    when displaying frm rep_mast, as there will b multiple columns, i kept those in "Details". Also,for the rep_mast i ll hav SubTotal for Value column.

    in the same report i hav to display contents of other 3 tables also.

    Of the remaining tables, rep_fandr and rep_others i'll hav multiple rows. its added to the table correctly. bt while displaying in the report i dont get all.only 1 is being viewed. y is it so?

    only the fields that are in the "Details" can hav multilple rows???

    bt. i need SubTotal for Value Column of rep_prd.

    aftr the Subtotal only other table contents shud b viewed.
    Preethi.

  6. #6

    Thread Starter
    Lively Member preethi_rjs's Avatar
    Join Date
    Dec 2006
    Posts
    80

    Smile Re: Help me with Crystal Report....URGENT

    rep_prd --> List of prod.names, so given in Details Part.
    rep_fandr + rep_others---> Details regarding Discount, Freight, etc.,

    After having List of Product's total only, i need these other details to be displayed.

    If rep_fandr and rep_others hav single row in its table i'm able to view. but if it has more rows, only the last row gets viewed.

    hw shud i make all the rows to be viewed????

    plzzzzzzzzzz help me solve this. its really very urgent.
    Last edited by preethi_rjs; Feb 22nd, 2007 at 08:47 AM.
    Preethi.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width