Page 1 of 1

Rendering in background thread / non UI-thread

Posted: Thu Jan 05, 2012 4:18 am
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.

Rendering in background thread / non UI-thread

Posted: Mon Jan 09, 2012 6:55 am
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.