Can u have multiple subreports in one report?
If so how do u set the datasource?
Dim DSOrders As New MDataset()
filldataset(DSOrders)
Dim RD As New MainReport() ' this is the mainreport.rpt
Dim RO As CrystalDecisions.CrystalReports.Engine.ReportObject
Dim SRO As CrystalDecisions.CrystalReports.Engine.SubreportObject
Dim SubDoc As CrystalDecisions.CrystalReports.Engine.ReportDocument
RO = RD.ReportDefinition.Sections.Item("Section3").ReportObjects.Item("Subreport1")
SRO = CType(RO, CrystalDecisions.CrystalReports.Engine.SubreportObject)
SubDoc = SRO.OpenSubreport(SRO.SubreportName)
SubDoc.SetDataSource(DSOrders)
This works for the 1st subreport if there is only one subreport.
I tried the same code with different variable names for the 2nd subreport and it displayed the 2nd report right and the 1st subreport came back empty.
What is the best method to have multople subreports in a report?
Each subreport is from different tables.
Any help appreciated
thanks
If so how do u set the datasource?
Dim DSOrders As New MDataset()
filldataset(DSOrders)
Dim RD As New MainReport() ' this is the mainreport.rpt
Dim RO As CrystalDecisions.CrystalReports.Engine.ReportObject
Dim SRO As CrystalDecisions.CrystalReports.Engine.SubreportObject
Dim SubDoc As CrystalDecisions.CrystalReports.Engine.ReportDocument
RO = RD.ReportDefinition.Sections.Item("Section3").ReportObjects.Item("Subreport1")
SRO = CType(RO, CrystalDecisions.CrystalReports.Engine.SubreportObject)
SubDoc = SRO.OpenSubreport(SRO.SubreportName)
SubDoc.SetDataSource(DSOrders)
This works for the 1st subreport if there is only one subreport.
I tried the same code with different variable names for the 2nd subreport and it displayed the 2nd report right and the 1st subreport came back empty.
What is the best method to have multople subreports in a report?
Each subreport is from different tables.
Any help appreciated
thanks