I am creatin a report in C#. It loads a report from a file, but then I need to add a certain amount of pages depending on some variable.
It is working great for 1 page but as soon as I need to add 2 or more I get a Object reference not set to an instance of an object. error.
The error occur on the report.Render() call..
If I debug the code. All the pages are added to the report and set to values...
Here is a shortened version of the code adding the pages...
StiReport report = new StiReport();
report.Load(@"c:\" + reportName + ".mrt");
StiPage page;
StiText text;
StiPage[] pages = new StiPage[extra.Count];
int count = 0;
foreach (string temp in extra)
{
page = new StiPage(report);
page.Load(@"c:\pageTemplatee.pg");
page.Name = "p" + count.ToString();
text = (StiText)page.Components["freeText"];
text.Name += count.ToString();
page.Page = page;
page.Report = report;
pages[count] = page;
count++;
}
report.Pages.AddRange(pages);
report.RegData(ds);
report.Render();
Problem adding pages.
Problem adding pages.
Hi, Alwessels.
Please send the test project which produces this error to support[at]stimulsoft.com for analysis.
Thank you.
Please send the test project which produces this error to support[at]stimulsoft.com for analysis.
Thank you.