I am using the CR Control of CR7 to report on a SQL Server Database but the
report it Generates is without
Data - Just field labels.
Here is my Code
Help!
Private Sub PrintReports()
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sSql As String
On Error GoTo dbErrors
sSql = "Select Customer.*, Carrier.*, Rates.* " _
& "From Customer,Carrier,Rates " _
& "Where Customer.CustomerID = " & intCustomerID & " " _
& "And Carrier.CarrierID = " & CarrierID & " " _
& "And Rates.CustomerID = " & intRateID & " " _
& "And Rates.CarrierID = Carrier.CarrierID " _
& "Order by Sector"
db.Open dbConnString
rs.Open sSql, db, adOpenStatic, adLockOptimistic
crpt.Connect = "Driver=SQL Server;Server=" & dbPath &
";Database=Network_Express"
crpt.ReportFileName = App.Path & "\Rate.rpt"
crpt.WindowState = crptMaximized
crpt.PrinterSelect
crpt.SetTablePrivateData 0, 3, rs
crpt.PrintReport
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Exit Sub
dbErrors:
MsgBox Err.Number & Err.Description, vbCritical, "Error Printing Report"
End Sub