A generic error occurred in GDI+ while running chart reports in Azure Websites

Posted by: udaybhanu.karmakar on 9 October 2017, 1:51 am EST

    • Post Options:
    • Link

    Posted 9 October 2017, 1:51 am EST

    There are few chart reports, which are working in local but failing when ran from Azure web sites, with following error:

    message=“A generic error occurred in GDI+.”

    source=“System.Drawing”

    detail="System.Exception: DisplayReport - GetReport - Failed unexpectedly —> System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Imaging.Metafile…ctor(IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, String description) at System.Drawing.Imaging.Metafile…ctor(IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type) at #mb.#uXm.#d4m(Graphics refGfx, RectangleF outputRect) at GrapeCity.ActiveReports.SectionReportModel.ChartControl.#LYA(GraphicsCache cache, Page page, PointF pageOffset, Single startPos, Single endPos) at GrapeCity.ActiveReports.SectionReportModel.ARControl.Render(GraphicsCache gRef, Page page, PointF pageOffset, Single startPos, Single endPos) at GrapeCity.ActiveReports.SectionReportModel.Section.Render(GraphicsCache cache, Page page, #Ppb drawingLog, PointF pageOffset, Single pageWidth, Single drawStartPos, Single drawEndPos) at #sxA.#mqb.#vDb() at #sxA.#vqb.#rEb() at #sxA.#vqb.#bZA(Page newPage, Single left, Single top, Single right, Single bottom, UInt32 flags, UInt32& status) at GrapeCity.ActiveReports.SectionReport.#4yb() at GrapeCity.ActiveReports.SectionReport.Run(Boolean syncDocument) at GrapeCity.ActiveReports.SectionReport.Run() at SmartCookies.Reports.DisplayReport.GetReport(NameValueCollection form)

  • Posted 10 October 2017, 11:20 pm EST

    For rendering Charts in ActiveReports, it requires the System.Drawing dll which is blocked on Azure and is most likely the cause of the error you’re facing. Please refer to the following post which has details about this - https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#win32ksys-user32gdi32-restrictions.

  • Posted 11 October 2017, 3:49 am EST

    What is the solution for this issue? Is there an alternate option to generate Charts in Active Reports running in Azure?

  • Posted 11 October 2017, 5:57 pm EST

    Please try changing the ImageType property of Chart control to “PNG” and check if the error goes away.

  • Posted 18 October 2017, 3:38 am EST

    Changing the ImageType did the trick. Reports are now running fine. Thank you!!

  • Posted 15 February 2018, 3:25 am EST

    I have the exact same issue and am using a page report and pdfexport via c#.

    But I can’t find a property “ImageType” on my chart controls.

    I also tried to set ConvertMetatoPdf on the PdfExport to true, but this didn’t help.

    Any ideas appreciated!

  • Posted 15 February 2018, 10:41 pm EST

    Hi Travis,

    Your question has been answered at your other forum post - https://www.grapecity.com/en/forums/ar-dev/gdi-error-on-pdf-export-wi

    Kindly check the reply there.

Need extra support?

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

Learn More

Forum Channels