on 09-28-2008 11:42 PM
I have built a report in Crystal XI that has two subReports. The report works fine when I run it from Crystal Designer, but when I integrate it into my App (VB6) I get the following error:
"This field name is not known"
If I remove the subReports from the report, the report runs, so I know the subReports are the problem, and strongly suspect that the subReport is not being opened properly.
This is the code I am using to open the subReports. Any help is greatly appreciated.
dim i as integer
i = 0
For Each CRXSection In CRXSections
Set CRXReportObjects = CRXSection.ReportObjects
For Each CRXReportObject In CRXReportObjects
If CRXReportObject.Kind = crSubreportObject Then
i = i + 1
Set CRXSubreportObj = CRXReportObject
Set CRXSubreport = CRXSubreportObj.OpenSubreport
Set rstSub(i) = RecordsetFactory
rstSub(i).open Sql(i), AppConnection, adOpenDynamic, adLockOptimistic
CRXSubreport.Database.SetDataSource rstSub(i), 3, 1
End If
Next CRXReportObject
Next CRXSection
Hi Raford,
What database driver are you using ?
Try to update the database connection for the report.
You can do that by opening report in designer, then
Go To Database Menu -> Setdatasource Location
Connect to the datasource you want and update the datasource.
Save the report.Now run from application.
As you are having issue through code i would suggest
you to post this query to the NET Development - Crystal Reports forum:
That forum is monitored by qualified technicians and you will get a faster response there.
Thank you for your understanding,
Regards,
Shweta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.