Merging report pages
Posted: Sun Jul 13, 2008 1:54 am
Hi,
I need to merge two report definitions, but I don't seem to be finding any solutions.
I can modify a report and add components to it in runtime with no problem, as long as the components are created.
If I add components of one report to another, I always get an exception upon report compilation.
Here's what I've tried:
1. Using sub-reports, adding a page from one report to the Pages collection of another report, and then setting the sub-report to show the added page.
2. Adding components by iterating through them from one report to another.
3. I tried cloning components instead of adding them directly (using "Clone" method), didn't work either.
I pay attention to set Parent and Page properties of the components correctly.
But all the time, I get a "NullReferenceException" with the following stack trace:
at Stimulsoft.Report.CodeDom.StiCodeDomSerializator.AddInit(String parent, Boolean isReference, StiPropertyInfo prop, Int32 pos)
at Stimulsoft.Report.CodeDom.StiCodeDomSerializator.AddInit(String parent, Boolean isReference, StiPropertyInfo prop)
at Stimulsoft.Report.CodeDom.StiCodeDomSerializator.Serialize(StiReport report, String name, StiLanguage language, Boolean serializeData, Boolean saveForInheritedReports, Object standaloneReportType)
at Stimulsoft.Report.CodeDom.StiCodeDomSerializator.Serialize(StiReport report, String name, StiLanguage language, Object standaloneReportType)
at Stimulsoft.Report.StiReport.ScriptUpdate(Object standaloneReportType)
at Stimulsoft.Report.StiReport.Compile(String path, Stream stream, StiOutputType outputType, Boolean autoCreate, Object standaloneReportType)
at Stimulsoft.Report.StiReport.Compile(String path, Stream stream, StiOutputType outputType, Boolean autoCreate)
at Stimulsoft.Report.StiReport.Compile(String path, StiOutputType outputType, Boolean autoCreate)
at Stimulsoft.Report.StiReport.Compile(String path, StiOutputType outputType)
at Stimulsoft.Report.StiReport.Compile(StiOutputType outputType)
at Stimulsoft.Report.StiReport.Compile()
What am I doing wrong?