I have these 2 independent subreports in the main report. But when i run it , the 2nd subreport shows the data and first subreport comes back empty . When I try to have only the first subreport, it shows the right data. I think setting the datasource or something is not right.Can anyone help me? My main report has no other data but only 2 subreports .
thanks
Here is the code.
Dim RD As New MainReport()
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)
'''Any report property can now be changed in the subreport, like the selection formula
SubDoc.SetDataSource(DSOrders)
Dim RO1 As CrystalDecisions.CrystalReports.Engine.ReportObject
Dim SRO1 As CrystalDecisions.CrystalReports.Engine.SubreportObject
Dim SubDoc1 As CrystalDecisions.CrystalReports.Engine.ReportDocument