Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subreports in main report

Status
Not open for further replies.

Injun

IS-IT--Management
Dec 17, 2002
30
US
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





 
Here's half an answer for you: Crystal has no problem handling one container report with many sub-reports. One A level report, many B level reports (note: NO c level reports)

How to address these from within 3rd party code, is the other half of the answer... sorry I don't have it.

~Thadeus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top