Results 1 to 2 of 2

Thread: printing data reports

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2006
    Location
    Philippines
    Posts
    177

    Thumbs down printing data reports

    heres my loop and code on how to print mulitple reports
    VB Code:
    1. For i = 1 To rsDis.RecordCount
    2.         Set rsDis1 = New ADODB.Recordset
    3.         Set rsDis1 = cn.Execute("select * from checktable where account_id = " & i)
    4.         Set DataReport1.DataSource = rsDis1
    5.         DataReport1.Sections(1).Controls("lblAccount").Caption = rsDis1.Fields("chkname").Value
    6.         DataReport1.Sections(1).Controls("lblDate").Caption = rsDis1.Fields("chkdate").Value
    7.         DataReport1.Sections(1).Controls("lblTotal").Caption = rsDis1.Fields("chkTotal").Value
    8.         DataReport1.Sections(1).Controls("lblNum2Wrd").Caption = rsDis1.Fields("chknumtoword").Value
    9.         DataReport1.Refresh
    10.         DataReport1.PrintReport False, rptRangeFromTo, 1, 1
    11.         rsDis1.Close
    12.     Next i

    if i run this code it will only print once and the only first page will print.. but when i use breakpoints on the datareport1.printreport.. it will print as many times as the loop is.. pls help!

  2. #2
    Addicted Member
    Join Date
    Jan 2006
    Location
    Bangalore
    Posts
    172

    Re: printing data reports

    try this



    remove line
    DataReport1.PrintReport False, rptRangeFromTo, 1, 1
    and place
    DataReport1.PrintReport true

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