
Crystal sub-reports problem using TTX file and data tables
Hi
I am having problems bringing my Crystal Reports over
to .NET. Simple reports work fine, it is when I try to
use my reports with subreports I encounter some parameter
problem with the sub-report link. The exact same report
works OK in VB6, so I guess my new .NET syntax is wrong
somewhere.
Any ideas??
The error message I get is:
"Error in file K\:Reports\ProductSummary.rpt:
Error in formula <Simplified Sub-Report Record Selection>
({ContractSummary_ttx.NPC} = {?Pm-ProductSummaryAll_ttx.NPC})
This field name is not known"
The code I am using is:
Dim crReport As ReportDocument
Dim crSubReport As ReportDocument
crReport = New ReportDocument()
crReport.Load("K:\Reports\ProductSummary.rpt")
'set reports datasource
crReport.SetDataSource(dsReport.Tables("PRODUCT"))
'set subreport
crSubReport = crReport.OpenSubreport("ContractLines.rpt")
'set subreport datasource
crSubReport.SetDataSource(dsReport.Tables("CONTRACT"))
'send the report to the viewer
crViewer.ReportSource = crReport