RichText-Usage is not thread safe ?!
Posted: Wed Oct 23, 2019 3:13 pm
Hello,
see sample project.
6 Datasources, same report template, 6 tasks render and export parallel.
When i use lock(StiReport) around the Render And Export-Methode, all fine. All 6 Pdfs are generated.
But without lock, two errors may occur:
1. There are an infinite number of empty pages produced (one or more threads).
or
2. an exceptions occurs: "The object is already in use elsewhere", at System.Drawing.Graphics.get_DpiX()
Our analysis showed that the error only occurs when RichText controls are used in the report. In the test project you can switch this, if you parameterize the report constructor accordingly.
true: RichText-Controls are used
false:RichText-Controls are not used
Line 18: using (StiReport report = new Report(true/false))
The lock variante is not a solution for us, because our product use also the RTF-Support, because then the error occurs anyway.
I hope you can help.
Greetings
see sample project.
6 Datasources, same report template, 6 tasks render and export parallel.
When i use lock(StiReport) around the Render And Export-Methode, all fine. All 6 Pdfs are generated.
But without lock, two errors may occur:
1. There are an infinite number of empty pages produced (one or more threads).
or
2. an exceptions occurs: "The object is already in use elsewhere", at System.Drawing.Graphics.get_DpiX()
Our analysis showed that the error only occurs when RichText controls are used in the report. In the test project you can switch this, if you parameterize the report constructor accordingly.
true: RichText-Controls are used
false:RichText-Controls are not used
Line 18: using (StiReport report = new Report(true/false))
The lock variante is not a solution for us, because our product use also the RTF-Support, because then the error occurs anyway.
I hope you can help.
Greetings