mariabenita
Programmer
how is previewing reports done dynamically using ado recordsets in vb6? we have already gone through the process of preparing the data for the report, the only problem is we can't find the method equivalent to .preview in crystal 7.
here's part of the code.
lsSql = "SelProcCustomer " & Chr(34) & SCUST & Chr(34)
' (This line initialized the variable to indicate where the report is located)
lsRpt = RPT_PATH & "\SAMP_RPT.RPT"
' (Get the Report content by opening a resultset of the SP)
If lRs.State = adStateOpen Then lRs.Close
lRs.Open lsSql, ADOCN, adOpenDynamic, adLockOptimistic
If Not lRs.BOF And Not lRs.EOF Then
lRs.MoveLast
Else
MsgBox "No record to print.", vbOKOnly, "Message"
Screen.MousePointer = vbDefault
Exit Sub
End If
' (Create an instance of the Crystal Application object)
' (Create an instance of the Crystal Report object from the Crystal Application object)
Set gcrpReport = lsApp.OpenReport(lsRpt)
' (Initialize Other objects required by the report)
Set reportDb = gcrpReport.Database
Set reportTables = reportDb.Tables
Set reportTable = reportTables.Item(1)
reportTable.SetPrivateData 3, lRs
' (View report to Screen)
??? (HELP)
here's part of the code.
lsSql = "SelProcCustomer " & Chr(34) & SCUST & Chr(34)
' (This line initialized the variable to indicate where the report is located)
lsRpt = RPT_PATH & "\SAMP_RPT.RPT"
' (Get the Report content by opening a resultset of the SP)
If lRs.State = adStateOpen Then lRs.Close
lRs.Open lsSql, ADOCN, adOpenDynamic, adLockOptimistic
If Not lRs.BOF And Not lRs.EOF Then
lRs.MoveLast
Else
MsgBox "No record to print.", vbOKOnly, "Message"
Screen.MousePointer = vbDefault
Exit Sub
End If
' (Create an instance of the Crystal Application object)
' (Create an instance of the Crystal Report object from the Crystal Application object)
Set gcrpReport = lsApp.OpenReport(lsRpt)
' (Initialize Other objects required by the report)
Set reportDb = gcrpReport.Database
Set reportTables = reportDb.Tables
Set reportTable = reportTables.Item(1)
reportTable.SetPrivateData 3, lRs
' (View report to Screen)
??? (HELP)