Page 1 of 1

Stackoverflow exception when creating report

Posted: Mon Apr 29, 2013 7:46 am
by Bart
We've come to a point where our report doesn't work anymore because of a StackOverflow exception when rendering the report from code.

The problem seems to be from how the report code is contstructed. The 'InitializeComponent' code is splitted by StimulReports over different 'InitializeComponent2', 'InitializeComponent3', ... methods. In our report, the code has 66 of this InitializeComponent methods. From somewhere around the 40th InitializeComponent, we get the stackoverflow exception.

This is because StimulReports calls each InitializeComponent method from within another one. So InitializeComponent calls InitializeComponent2, which in turn calls InitializeComponent3, etc. This creates a large call stack which gives us eventually the stackoverflow exception.

The workaround for now is to modify the generated code so it looks like this:

public Report()
{
this.InitializeComponent();
this.InitializeComponent2();
this.InitializeComponent3();
this.InitializeComponent4();
...
this.InitializeComponent66();
}

This is a problem since we always have to modify the code when changes need to be published, and we need to add new code and provide a new software build to our clients, which is nearly impossible because our reports
may change several times a week.

The problem started to occur since we switched from .NET framework 4 to 4.5. Probably since version 4.5 more information is added to the stack so there is less space for nested calls.

Is there any workaround you can suggest or can this issue be addressed in future release?

Re: Stackoverflow exception when creating report

Posted: Tue Apr 30, 2013 9:50 am
by HighAley
Hello.

The issue is fixed.
We have applied your suggestions with some changes.
But we can't understand we this error was occurred. 40 method is not so much for the stack.
Do you have any assumption?

Thank you.

Re: Stackoverflow exception when creating report

Posted: Tue Apr 30, 2013 11:11 am
by JorisWils
Hi

We are facing the same problem. When will the prerelease build be available for this issue?

thx

Re: Stackoverflow exception when creating report

Posted: Tue Apr 30, 2013 12:34 pm
by Alex K.
Hello,

The next prerelease build will be available on this week.

Thank you.