Page 1 of 1

Multithreading exception

Posted: Thu Jan 28, 2010 7:54 am
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

Multithreading exception

Posted: Tue Feb 02, 2010 1:00 am
by Jan
Hello Ladislav,

Please check build from 1 Feb.

Thank you.

Multithreading exception

Posted: Tue Feb 02, 2010 7:05 am
by burkovsky
Hi,

1.Feb build works nicely

Ladislav

Multithreading exception

Posted: Tue Feb 02, 2010 8:46 am
by Jan
Hello Ladislav,

Thank you for your information.