Stackoverflow exception when creating report

Stimulsoft Reports.WPF discussion
Post Reply
Bart
Posts: 5
Joined: Tue Feb 03, 2009 6:34 am

Stackoverflow exception when creating report

Post 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?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Stackoverflow exception when creating report

Post 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.
JorisWils
Posts: 86
Joined: Tue Jun 30, 2009 7:49 am
Location: belgium

Re: Stackoverflow exception when creating report

Post by JorisWils »

Hi

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

thx
Using Stimulsoft since 2007
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Stackoverflow exception when creating report

Post by Alex K. »

Hello,

The next prerelease build will be available on this week.

Thank you.
Post Reply