Multithreading exception

Stimulsoft Reports.NET discussion
Post Reply
burkovsky
Posts: 8
Joined: Thu Oct 15, 2009 4:49 am
Location: Germany

Multithreading exception

Post by burkovsky »

Hi,

I have a reports which renders perfectly on single thread.
If I generate many of them in several threads it crashes in
ExportDocument(StiExportFormat.Pdf, memoryStream)

System.InvalidOperationException was unhandled
Message="Das Objekt wird bereits an anderer Stelle verwendet."
Source="System.Drawing"
StackTrace:
bei System.Drawing.Image.get_RawFormat()
bei System.Drawing.Graphics.IgnoreMetafileErrors(Image image, Int32& errorStatus)
bei System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y)
bei System.Drawing.Graphics.DrawImageUnscaled(Image image, Int32 x, Int32 y)
bei Stimulsoft.Base.Drawing.StiShadow.DrawLeftShadow(Graphics g, Rectangle rect)
bei Stimulsoft.Base.Drawing.StiShadow.DrawCachedShadow(Graphics g, Rectangle rect, StiShadowSides sides)
bei Stimulsoft.Base.Drawing.StiShadow.DrawCachedShadow(Graphics g, RectangleF rect, StiShadowSides sides, Boolean isSimple)
bei Stimulsoft.Report.Painters.StiGdiChartElements.DrawCachedShadow(Object context, Rectangle rect, StiShadowSides sides, Boolean isPrinting)
bei Stimulsoft.Report.Chart.StiLegend.Draw(Object context)
bei Stimulsoft.Report.Painters.StiChartGdiPainter.DrawChart(StiChart chart, Graphics g, RectangleF rect, Boolean useMargins)
bei Stimulsoft.Report.Painters.StiChartGdiPainter.PaintChart(StiChart chart, Graphics g, RectangleF rect, Boolean drawBorder)
bei Stimulsoft.Report.Painters.StiChartGdiPainter.GetImage(StiComponent component, Single& zoom, StiExportFormat format)
bei Stimulsoft.Report.Chart.StiChart.GetImage(Single& zoom, StiExportFormat format)
bei Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
bei Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
bei Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream, StiExportSettings settings)
bei Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream)

VisualStudio also shows:
If you are using the Graphics object after the GetHdc method, call the ReleaseHdc method.
This will release the context handle obtained by a previous call to the GetHdc method of the Graphics object.



Regards,
Ladislav
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Multithreading exception

Post by Jan »

Hello Ladislav,

Please check build from 1 Feb.

Thank you.
burkovsky
Posts: 8
Joined: Thu Oct 15, 2009 4:49 am
Location: Germany

Multithreading exception

Post by burkovsky »

Hi,

1.Feb build works nicely

Ladislav
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Multithreading exception

Post by Jan »

Hello Ladislav,

Thank you for your information.

Post Reply