I have an unusual issue which a customer in our live system recently pointed out.
I am dynamically creating a main report with sub-reports in c#. In this particular case, two of the sub reports come from the same MRT which is saved as c# code in my project. This template is in the attached zip (ComparisonTable.mrt), along with test data.
The main report is filled using
Code: Select all
Select allmainReport.SubReports.Add(stiReport, false, false);
Each sub-report which uses the ComparisonTable template gets its own instance of the class. The data in the dataset contains a mixture of texts and byte arrays for the icons. When I run the code in the debugger and stop once each sub-report has rendered, I can save the sub reports and view them - here, the data is fine, no problem. After each sub-report has been rendered it is added to the main report using the code above.
Now the strange phenomenon arises: the first "ComparisonTable" report is using the icons from the dataset for the second "ComparisonTable" report but it is using the texts from its own dataset!
Even though the "ComparisonTable" reports have exactly the same structure and typified dataset they should be completely separate once added to the main report. It seems to me as though the icons from the second dataset are being cached internally in some way and then used for displaying in the first report.
I would be most grateful for your assistance here.
Best regards,
John Kitching
In the attachment:
- ComparisonTable.mrt and test data
- Table1.pdf: the first sub-report of ComparisonTable, saved while running in the debugger
- Table2.pdf: the second sub-report of ComparisonTable
- FinalReport.pdf: the main report containing the 2 sub-reports (and some other stuff which can be ignored)