A generic error occurred in GDI+

Posted by: jay.hasell on 28 September 2017, 2:22 am EST

  • Posted 28 September 2017, 2:22 am EST

    My company is using ActiveReports v10. Some reports are failing and the Event Viewer records the error as:

            <Exception>
                        <Description>
                            A generic error occurred in GDI+.
                        </Description>
                        <Source>
                            System.Drawing
                        </Source>
                        <Method>
                            Void Save(System.IO.Stream, System.Drawing.Imaging.ImageCodecInfo, System.Drawing.Imaging.EncoderParameters)
                        </Method>
                        <Stack>
                               at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
                               at #Xkc.#Hpc.#Uuc(Image image, ImageFormat format)
                               at #qSr.#tKg.#hg(Image image, ImageFormat imageFormat, Boolean withoutImageMark)
                               at #qSr.#tKg.#hg(Image image, ImageFormat imageFormat, Boolean withoutImageMark, String key)
                               at GrapeCity.ActiveReports.Export.Pdf.Page.Core.PdfDrawingCanvas.#U.#Ync..ctor(Image image, Boolean isPdfA1, String cacheId)
                               at GrapeCity.ActiveReports.Export.Pdf.Page.Core.PdfDrawingCanvas.CreateImage(Image image, String cacheId)
                               at #HyA.#Y4e.#3Bf(IGraphicsRenderContext context, ILayoutArea area)
                               at #pSr.#brc.RenderReportItem(ILayoutArea area)
                               at #HyA.#Y4e.#1Bf(IGraphicsRenderContext context, ILayoutArea area)
                               at #HyA.#Y4e.#0Bf(IGraphicsRenderContext context, ILayoutArea area)
                               at #pSr.#brc.RenderReportItem(ILayoutArea area)
                               at #HyA.#Y4e.#1Bf(IGraphicsRenderContext context, ILayoutArea area)
                               at #HyA.#Y4e.#0Bf(IGraphicsRenderContext context, ILayoutArea area)
                               at #pSr.#brc.RenderReportItem(ILayoutArea area)
                               at #HyA.#Y4e.#1Bf(IGraphicsRenderContext context, ILayoutArea area)
                               at #HyA.#Y4e.#0Bf(IGraphicsRenderContext context, ILayoutArea area)
                               at #pSr.#lV.#ROf(ILayoutArea section)
                               at #pSr.#lV.#1Db(ILayoutPage page)
                               at GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension.#DSg(IDrawingCanvas canvas, Int32 pageIndex, TargetDeviceKind device)
                               at GrapeCity.ActiveReports.Export.Image.Page.PageController.PageController.RenderPhysicalPage(Int32 physicalPageIndex, Int32 pageCount, IDrawingCanvas canvas, RectangleF pageSize, RectangleF reportPageSize, IReport report, TargetDeviceKind device)
                               at GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension.Render(IReport report, StreamProvider streams, NameValueCollection settings)
                               at GrapeCity.ActiveReports.Document.PageDocument.Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings, Boolean forceDataRefresh, Boolean forceParameterDataRefresh)
                        </Stack>
            </Exception>
    
    

    Has anyone else run into this issue? Please let me know. Thanks.

  • Posted 28 September 2017, 11:31 pm EST

    Hello,

    This looks like an issue with creating an image:



    Void Save(System.IO.Stream, System.Drawing.Imaging.ImageCodecInfo, System.Drawing.Imaging.EncoderParameters)

    while exporting to PDF.

    Could you please provide your sample application for us to debug? Also let me know your machine configuration.

    Thanks,

    Deepak Sharma

  • Posted 5 January 2019, 10:04 am EST

    I am getting the same error. If I use the LoadFromFile method on the GrapeCity picture control, I have no problems.

    If I load file into a memory stream and create image from memory stream, then I get this error.

    Note that I never get this issue with the Microsoft Picture control in winforms.

    I am using ActiveReports 12 and .NetFramework 4.7.2.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels