stangeljl18
Programmer
I have a report which will not completely export to a crystal report file when using the RDC.
There are a total of 6 subreports all of which use the same SQL-ODBC File DSN. They all are stored procedures.
The code goes something like this...
'Set logon for main report
For I = 1 To mReport.Database.Tables.Count
Call mReport.Database.Tables.Item(I).SetLogOnInfo("", "", "User", "Password"
Next
'Set logon for sub reports
For Each CRXSection In mReport.Sections
For Each ReportObject In CRXSection.ReportObjects
If ReportObject.Kind = crSubreportObject Then
Dim subreport2 As CRAXDRT.SubreportObject
Set CRXSubreportObj = ReportObject
Set subreport = RXSubreportObj.OpenSubreport
For I = 1 To subreport.Database.Tables.Count
Call subreport.Database.Tables.Item(I).SetLogOnInfo("", "", "User", "Password"
Next
End If
Next ReportObject
Next CRXSection
Call mReport.Export(True)
When I Export to Crystal, two of the subreports do not get logged in properly and the report is missing the data for them.
If I export that same report to PDF, the whole report gets exported properly.
Any ideas?
There are a total of 6 subreports all of which use the same SQL-ODBC File DSN. They all are stored procedures.
The code goes something like this...
'Set logon for main report
For I = 1 To mReport.Database.Tables.Count
Call mReport.Database.Tables.Item(I).SetLogOnInfo("", "", "User", "Password"
Next
'Set logon for sub reports
For Each CRXSection In mReport.Sections
For Each ReportObject In CRXSection.ReportObjects
If ReportObject.Kind = crSubreportObject Then
Dim subreport2 As CRAXDRT.SubreportObject
Set CRXSubreportObj = ReportObject
Set subreport = RXSubreportObj.OpenSubreport
For I = 1 To subreport.Database.Tables.Count
Call subreport.Database.Tables.Item(I).SetLogOnInfo("", "", "User", "Password"
Next
End If
Next ReportObject
Next CRXSection
Call mReport.Export(True)
When I Export to Crystal, two of the subreports do not get logged in properly and the report is missing the data for them.
If I export that same report to PDF, the whole report gets exported properly.
Any ideas?