Hi All,
This question has probably been posted and answered by others a thousand times, but I'm hoping to receive a positive response
It is straight forward to load a report dynamically from a file using something like this (c# code):
ReportDocument repDoc = new ReportDocument();
repDoc.Load(repFilePath);
CrystalReportViewer1.Visible = true;
CrystalReportViewer1.ReportSource = repDoc;
CrystalReportViewer1.RefreshReport();
However, I have a requirement that consists on a Main report with 3 subreports, but where those subreports need to be loaded dynamically. For example, you may want to load reports "1.rpt", "2.rpt" and "3.rpt" in one occasion and reports "a.rpt", "b.rpt" and "c.rpt" in another occasion.
The main reason for this is that 1 PDF has to be created from the reports, and doing it this way would save me from having to use 3rd party tools to merge the PDFs (if I were to load each report separately).
I've spent hours looking around for a valid solution but they all point to RAS, and I'm afraid it is not an option for me.
I've tried using iterations of the following without any success:
- repDoc.OpenSubreport("subreportName")
- repDoc.Subreports["subreportName.rpt"].Load("strFilePath");
Any help would be appreciated!!
I'm using C# with VS2008 (framework 3.5), but upgrade to 4.0 and VS2012 is an option if it helps...
Thanks in advance for any answers!
Regards,
Gonzalo