This is a migrated thread and some comments may be shown as answers.

Generic GDI Error

9 Answers 468 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eastern
Top achievements
Rank 1
Eastern asked on 27 Jun 2011, 08:23 PM
i am using RadControls Winforms Q1 2011 SP1 with Reporting Q1 2011 SP1,

in one of my reports in the page between 85-95 i get "A Generic GDI+ error occured"..
i tried a lot and the source of problem is a picturebox in my report that show the Student pictures.
Student objects loaded with Nhibernate

here is the stack trace from output window:

*** RENDER PAGES STARTED ***
*** RENDER PAGES DONE in 00:00:16.6764322 ***

An error has occurred while rendering the report: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
   at System.Drawing.Imaging.Metafile..ctor(Stream stream)
   at Telerik.ReportViewer.WinForms.DrawablePage..ctor(Stream stream)
   at Telerik.ReportViewer.WinForms.PageLayout.AddPage(Stream stream)
   at Telerik.ReportViewer.WinForms.WinViewer.OnStreamReady(Object sender, StreamReadyEventArgs eventArgs)
   at Telerik.ReportViewer.WinForms.RenderFileManager.OnStreamReady(StreamReadyEventArgs eventArgs)
   at Telerik.ReportViewer.WinForms.RenderFileManager.RenderStream.Telerik.Reporting.Processing.IRenderStream.Finish()
   at Telerik.Reporting.ImageRendering.CompositionGdi.SendPhysicalPages()
   at Telerik.Reporting.ImageRendering.CompositionBase.SendPhysicalPages(Boolean force)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.ProcessPages(CompositionBase composition, RenderingElement renderingReport, Int32 startPage, Int32 endPage, Boolean render)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.ProcessPages(Report report, CompositionBase composition, Int32 startPage, Int32 endPage, Boolean render)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.RenderPages(Report report, CompositionBase composition)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.RenderReport(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
*** RenderReport #0 DONE in 00:00:16.7004656 ***

*** ReportProcessor.Render DONE in 00:03:24.9680921 ***

WinViewer> An error has occurred while rendering a report:
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
   at System.Drawing.Imaging.Metafile..ctor(Stream stream)
   at Telerik.ReportViewer.WinForms.DrawablePage..ctor(Stream stream)
   at Telerik.ReportViewer.WinForms.PageLayout.AddPage(Stream stream)
   at Telerik.ReportViewer.WinForms.WinViewer.OnStreamReady(Object sender, StreamReadyEventArgs eventArgs)
   at Telerik.ReportViewer.WinForms.RenderFileManager.OnStreamReady(StreamReadyEventArgs eventArgs)
   at Telerik.ReportViewer.WinForms.RenderFileManager.RenderStream.Telerik.Reporting.Processing.IRenderStream.Finish()
   at Telerik.Reporting.ImageRendering.CompositionGdi.SendPhysicalPages()
   at Telerik.Reporting.ImageRendering.CompositionBase.SendPhysicalPages(Boolean force)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.ProcessPages(CompositionBase composition, RenderingElement renderingReport, Int32 startPage, Int32 endPage, Boolean render)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.ProcessPages(Report report, CompositionBase composition, Int32 startPage, Int32 endPage, Boolean render)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.RenderPages(Report report, CompositionBase composition)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.RenderReport(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.Telerik.Reporting.Processing.IRenderingExtension.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
   at Telerik.Reporting.Processing.ReportProcessor.Render(IList`1 reports, ExtensionInfo extensionInfo, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback)
   at Telerik.ReportViewer.WinForms.RenderingThread.ThreadFunc(Object o)
The thread 0x1828 has exited with code 0 (0x0).

9 Answers, 1 is accepted

Sort by
0
Michael Hilgers
Top achievements
Rank 1
answered on 28 Jun 2011, 09:43 AM
Sometimes i'm getting the same error when i'm trying to display large amounts of data (+500 Pages). Is there a hard limit for memory etc.which is reached?
0
Steve
Telerik team
answered on 28 Jun 2011, 10:01 AM
Hi guys,

We've released an internal build that improves performance by reducing the memory footprint and increaseing the speed of processing and rendering reports. Currently only the WinForms and WPF viewers take full advantage of these performance optimizations, however the WebForms and Silverlight viewers are next to be improved and we hope that we would have similar results for the upcoming Q2 release. Please upgrade and let us know if further help is needed.

All the best,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Eastern
Top achievements
Rank 1
answered on 28 Jun 2011, 11:05 AM
i found the source of the problem, the problem is with Scale Proportional  mode of picturebox when the picture is null.
some student objects have not any picture assigned to them , so when it want to scale proportional it , throw this exception.

i solve this problem by creating a method and do the scale things myself in it and assign that method to the Picturebox value.

hope it would be helpful.
0
Michael Hilgers
Top achievements
Rank 1
answered on 28 Jun 2011, 11:18 AM
I'm using the PictureBox with Scale Proportional mode too. But in my case it's working as expected even if there is no Value for the PictureBox. Think that's not the basic problem.
0
Eastern
Top achievements
Rank 1
answered on 28 Jun 2011, 11:26 AM
this problem occurs in pages bigger than 100. i think the memory problem have some effect when it want to change the scale of pictures.

is it safe to use 603 version in applications? is it a final release or it may change ?
0
Michael Hilgers
Top achievements
Rank 1
answered on 08 Jul 2011, 08:13 AM
Okay, i integrated the internal build in our application and it seems to use less memory and to be a litte bit faster than before.

But now i'm creating a article catalog with pictures. This could be 10000 articles which all have a picture which are currenty stored in the file system. The report has to display 2 textboxes and the image for every article. When starting the preview the engine is working, than starts do display the pages (you can see the page count rising in the top bar of the report viewer). But then after approx. 50 pages it crashes with an GDI+ error. The used memory of the application rised to approx 1.3 GB, befor starting the report it was arround 100 MB.

Without the images on the report it's working perfect, but when the images come into the game, i always get the GDI+ error.

What can i do?

Kind Regards,
Michael
0
Michael Hilgers
Top achievements
Rank 1
answered on 11 Jul 2011, 11:17 AM
Any ideas?

I can't provide a demo because all data (pictures, database) are protected by a NDA.
0
Steve
Telerik team
answered on 11 Jul 2011, 01:00 PM
Hi Michael,

The upcoming Q2 release should resolve this problem. We are currently in final stages of testing and polishing the release expected by the end of the week.

Best wishes,
Steve
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Michael Hilgers
Top achievements
Rank 1
answered on 11 Jul 2011, 01:29 PM
That would be great! Lookin forward to it!
Tags
General Discussions
Asked by
Eastern
Top achievements
Rank 1
Answers by
Michael Hilgers
Top achievements
Rank 1
Steve
Telerik team
Eastern
Top achievements
Rank 1
Share this question
or