I am using following code to display records in CRViewer.
But how to add more pages to the CRViewer as the record pointer moves
to the next record.
Code:Private Sub Form_Load() Dim tot, i, t Screen.MousePointer = vbHourglass 'Set Report = CApp.OpenReport(App.Path & "\reports\Cryspermit_Recordset.rpt") Set rsReport = New ADODB.Recordset Set Report = New CrystalReport1_Recordset2 If rsReport.State = adStateClosed Then rsReport.Open "Select * from PermitReport", CN, adOpenKeyset, adLockReadOnly End If Report.Database.AddADOCommand rsReport.ActiveConnection, rsReport.ActiveCommand tot = rsReport.RecordCount CRViewer1.ReportSource = Report For i = 1 To tot With Report .txtPermitNo.SetText rsReport!permitno .txtPermitHolder.SetText rsReport!PermitHolder If i <> tot Then rsReport.MoveNext End If End With Next i CRViewer1.ViewReport Screen.MousePointer = vbDefault End Sub




Reply With Quote