Rendering in background thread / non UI-thread

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

Rendering in background thread / non UI-thread

Post by Bart »

I render stimulsoft reports in a background process, this used to work fine. Recently I had to switch to the RenderWithWPF method instead of the Render method, and now I always get the following exception:
System.InvalidOperationException: The calling thread must be STA, because many UI components require this.
For client side applications, the workaround is to get the rendering process out of the background thread. But for windows services that doesn't work, because there is no UI thread.

Why does RenderWithWPF needs access to the UI thread, unlike the Render method?

How can RenderWithWPF() work in a background thread?

Note: I already set the "DisplayProgress" to false.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Rendering in background thread / non UI-thread

Post by HighAley »

Hello.
Bart wrote:I render stimulsoft reports in a background process, this used to work fine. Recently I had to switch to the RenderWithWPF method instead of the Render method, and now I always get the following exception:
System.InvalidOperationException: The calling thread must be STA, because many UI components require this.
For client side applications, the workaround is to get the rendering process out of the background thread. But for windows services that doesn't work, because there is no UI thread.

Why does RenderWithWPF needs access to the UI thread, unlike the Render method?

How can RenderWithWPF() work in a background thread?

Note: I already set the "DisplayProgress" to false.
Did you call render method this way?

Code: Select all

RenderWithWPF(false)
If it doesn't work, please, send us a sample project for analysis.

Thank you.
Post Reply