Page 1 of 1

An error occurs dirung render: The calling thread must be STA...

Posted: Mon Sep 04, 2023 1:15 pm
by frontez
Hi, we have a stimulsoft form with RTF text, before we've been using Render(false) method on our server to render documents, and it worked.
Now we are trying to use RenderWithWpf(false) with the same template and same data, but it produces an exception:

Message: "The calling thread must be STA, because many UI components require this."
Source: "PresentationCore"

StackTrace:
at System.Windows.Input.InputManager..ctor()
at System.Windows.Input.InputManager.GetCurrentInputManagerImpl()
at System.Windows.Input.KeyboardNavigation..ctor()
at System.Windows.FrameworkElement.FrameworkServices..ctor()
at System.Windows.FrameworkElement.EnsureFrameworkServices()
at System.Windows.FrameworkElement..ctor()
at System.Windows.Controls.Control..ctor()
at System.Windows.Controls.Primitives.TextBoxBase..ctor()
at System.Windows.Controls.RichTextBox..ctor(FlowDocument document)
at Stimulsoft.Report.Painters.StiRichTextWpfPainter.Measure(Double width, StiComponent comp)
at Stimulsoft.Report.Components.StiRichText.GetActualSize()
at Stimulsoft.Report.Components.StiContainerHelper.CheckSize(StiComponent component)
at Stimulsoft.Report.Engine.StiContainerV2Builder.InternalRender(StiComponent masterComp)
at Stimulsoft.Report.Engine.StiEngine.InternalRenderBand(StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents, Boolean& isChildsEnabled)
at Stimulsoft.Report.Engine.StiEngine.RenderBand(StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents)
at Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderBand(StiDataBand masterDataBand, StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents)
at Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderMaster(StiDataBand masterDataBand)
at Stimulsoft.Report.Engine.StiPageHelper.RenderPage(StiPage page)
at Stimulsoft.Report.Engine.StiRenderProviderV2.RenderReport(StiReport report, StiReport masterReport, StiRenderState state)
at Stimulsoft.Report.Engine.StiRenderProviderV2.Render(StiReport report, StiRenderState state)
at Stimulsoft.Report.Engine.StiReportV2Builder.RenderSingleReport(StiReport masterReport, StiRenderState renderState)
at Stimulsoft.Report.StiReport.RenderReport(StiRenderState renderState)
at Stimulsoft.Report.StiReport.Render(StiRenderState renderState, StiGuiMode guiMode)
at Stimulsoft.Report.StiReport.RenderWithWpf(Boolean showProgress)

------------
Stimulsoft.Report.dll version is: 2019.3.3.0
Stimulsoft.Report.Wpf.dll version is: 2019.3.3.0

Re: An error occurs dirung render: The calling thread must be STA...

Posted: Tue Sep 05, 2023 9:44 pm
by Lech Kulikowski
Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.