StackOverflowException during report.Compile() call

Stimulsoft Reports.NET discussion
Post Reply
Gerald Clette
Posts: 2
Joined: Tue Sep 16, 2008 3:06 am

StackOverflowException during report.Compile() call

Post by Gerald Clette »

Hi.

During some tests with Stimulsoft, a StackOverflowException raised in a (long ...) call to report.Compile().

My project is based on the RuntimeBuildReport sample project.
I've just changed the button1_Click method like this :

private void button1_Click(object sender, System.EventArgs e)
{
StiReport report = new StiReport();
// Try to generate a BIG report
GenerateMassiveReport(report);

report.Compile();
report.Design(true);
}

private void GenerateMassiveReport(StiReport report)
{
StiReportUnitType unit = report.ReportUnit;
report.ReportUnit = StiReportUnitType.Centimeters;

for (int p = 0; p < 20; ++p)
{
StiPage page = new StiPage(report);
page.Name = "P" + p;
for (int x = 0; x < 9; ++x)
{
for (int y = 0; y < 28; ++y)
{
StiText newText = new StiText(new RectangleD(x * 2, y * 1, 1.75, 0.75));
newText.Text = "P" + p + "Cel " + x + ":" + y;
newText.Name = "P" + p + "CelX" + x + "Y" + y;
page.Components.Add(newText);
}
}
report.Pages.Add(page);
}
report.ReportUnit = unit;
}

The exception raised when I call directly Compile as well as when I click on the Preview tab in the designer (in this case, I comment the "report.Compile();" in the source code).

The exact exception message is : An unhandled exception of type 'System.StackOverflowException' occurred in Stimulsoft.Report.dll
I'm testing the Version 2008.2.275 from 10 September 2008

Thank you for your help.
Gérald

Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

StackOverflowException during report.Compile() call

Post by Vital »

Hello Gerald,

Sorry we can't fix this problem. When you call compile method report engine create report class. This class describes all components in report. I receive class wich have size around 10 000 000 bytes. This operation take some time and generate big amount of recursive calls. After then report engine call native .net methods for compilling this class. This is second problem. In some cases .net compiler may generate stack overflow exception when class is very big. I don't receive errors on my computers, but you can receive some exception. It depends from size of progam stack.

Thank you.
Post Reply