I want to merge several reports in one report:
Then I add several subreports to this report through the following method:MyReport = new StiReport();
MyReport.ReportName = "ReportName";
MyReport.ReportAlias = "ReportAlias";
This works fine, but when I execute Report.Render, I get the following exception:private static void AddSubReport(tdsReportData data, Stimulsoft.Report.StiReport mainReport, Stimulsoft.Report.StiReport subReport)
{
subReport.Dictionary.Databases.Clear();
subReport.RegData("tdsData", data);
mainReport.SubReports.Add(subReport, false, false);
}
What can be the cause of this problem. Am I forgetting to execute some method?System.NullReferenceException: Object reference not set to an instance of an object.
at Stimulsoft.Report.StiReport.get_TotalPageCount()
at Stimulsoft.Report.Engine.StiPostProcessProviderV2.PostProcessPages(StiPagesCollection pages)
at Stimulsoft.Report.Engine.StiReportV2Builder.RenderSubReports(StiReport ownerReport, StiRenderState renderState)
at Stimulsoft.Report.StiReport.Render(StiRenderState renderState)
at Stimulsoft.Report.StiReport.Render(Boolean showProgress, Int32 fromPage, Int32 toPage)
at Stimulsoft.Report.StiReport.Render(Boolean showProgress)
at Stimulsoft.Report.StiReport.Render()
We create our StimulReports nowadays in one report, not multiple subreports. This concerns a legacy report of which I need to make a new build now, it seems the problem occurs only since version 2008.2.
Hope someone can help me out. Thanks.