Multiple reports in one Cystal Report.
I have 2 or more reports and I want to be able to open them in a single report. Let's call it the master report. In this report I want to open several reports, that are independent one to another. I'm using this code to generate the raports:
Code:
Dim crDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim cmd As New OleDb.OleDbCommand
Dim da As New OleDb.OleDbDataAdapter
Dim dt As New DataTable
Dim crTemp As New crMyReport
cmd.CommandText = "SELECT * FROM myTable " & param
cmd.Connection = myDatabaseConnection
da.SelectCommand = cmd
da.Fill(dt)
crDocument = crTemp
crDocument.Load("crMyReport.rpt")
crDocument.Database.Tables("command").SetDataSource(dt)
rptViewer.DisplayGroupTree = False
rptViewer.ShowGroupTreeButton = False
rptViewer.ReportSource = Nothing
rptViewer.ReportSource = crDocument
Me.Show()
rptViewer.Show()
With this code I rewrite the datasource of the raport, and I can filter the query by the 'param' variable in the query.
After setting the datasource of the report i can save the raport:
Code:
crDocument.ExportToDisk(CrystalDecisions.[Shared].ExportFormatType.RichText, "C:\temp.rtf")
into rtf, pdf, etc. I want to append more of these reports into a master empty report. Or load these reports as subreports into a master empty report. I've tried everything , researched online, but didn't managed to find any guides. Can anyone help me?