PDA

Click to See Complete Forum and Search --> : printing data reports


popodc
May 2nd, 2006, 03:10 AM
heres my loop and code on how to print mulitple reports

For i = 1 To rsDis.RecordCount
Set rsDis1 = New ADODB.Recordset
Set rsDis1 = cn.Execute("select * from checktable where account_id = " & i)
Set DataReport1.DataSource = rsDis1
DataReport1.Sections(1).Controls("lblAccount").Caption = rsDis1.Fields("chkname").Value
DataReport1.Sections(1).Controls("lblDate").Caption = rsDis1.Fields("chkdate").Value
DataReport1.Sections(1).Controls("lblTotal").Caption = rsDis1.Fields("chkTotal").Value
DataReport1.Sections(1).Controls("lblNum2Wrd").Caption = rsDis1.Fields("chknumtoword").Value
DataReport1.Refresh
DataReport1.PrintReport False, rptRangeFromTo, 1, 1
rsDis1.Close
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!

CodeMaker
May 3rd, 2006, 07:48 AM
try this



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