I'm using Crystal Reports 8 in VB6. I have designed a report using the designer tools within VB6 so I am not referenceing any outside .RPT file. That report works just fine. The problem occurs when I try to integrate a subreport into it. I set everything up as it should be (as far as I can tell) but when my program attempts to run the report, I get the error: "File not found".
What could be the problem? I'm stumped! I would appreciate any help you could give me or if you could tell me where to find good documentation on this sort of thing.
I thank you in advance.
P.S. Below is the code I'm using in the VB form that contains the Crystal Reports Viewer. Perhaps you may be able to spot some errors that I can't. - Thanks again...
'''''''''''''''''''''''''''''''''''''''''
Dim rptMainReport As New crptMain
Private Sub Form_Load()
Dim sQuery As String
sQuery = "SELECT TOP 20 * FROM Client_Master"
Screen.MousePointer = vbHourglass
Dim rs As New ADODB.Recordset
rs.Open sQuery, g_oConn
rptMainReport.Database.SetDataSource rs
rptMainReport.ReadRecords
rptMainReport.OpenSubreport "srProviders"
crvMain.ReportSource = rptMainReport
crvMain.ViewReport
'Clean up
Set rptMainReport = Nothing
rs.Close
Set rs = Nothing
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
crvMain.Top = 0
crvMain.Left = 0
crvMain.Height = ScaleHeight
crvMain.Width = ScaleWidth
End Sub
What could be the problem? I'm stumped! I would appreciate any help you could give me or if you could tell me where to find good documentation on this sort of thing.
I thank you in advance.
P.S. Below is the code I'm using in the VB form that contains the Crystal Reports Viewer. Perhaps you may be able to spot some errors that I can't. - Thanks again...
'''''''''''''''''''''''''''''''''''''''''
Dim rptMainReport As New crptMain
Private Sub Form_Load()
Dim sQuery As String
sQuery = "SELECT TOP 20 * FROM Client_Master"
Screen.MousePointer = vbHourglass
Dim rs As New ADODB.Recordset
rs.Open sQuery, g_oConn
rptMainReport.Database.SetDataSource rs
rptMainReport.ReadRecords
rptMainReport.OpenSubreport "srProviders"
crvMain.ReportSource = rptMainReport
crvMain.ViewReport
'Clean up
Set rptMainReport = Nothing
rs.Close
Set rs = Nothing
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
crvMain.Top = 0
crvMain.Left = 0
crvMain.Height = ScaleHeight
crvMain.Width = ScaleWidth
End Sub