Runtime error with C1Report on Azure website

Posted by: jonattree on 16 May 2019, 9:02 pm EST

    • Post Options:
    • Link

    Posted 16 May 2019, 9:02 pm EST

    Hi I have a webforms app using C1Report which all works fine on my dev machine. Just deployed it to Azure App Service and all the reports generate a runtime error which appears to be something to do with fonts. Here is the stack trace:

    [ArgumentException: Parameter is not valid.] System.Drawing.Graphics.GetHdc() +1147821 C1.Util.#e2.#6x(FontSubSet owner, String tableName) +149 C1.Util.FontSubSet.GetFontTableStream(String name) +5 C1.Util.FontSubSet.#vpd() +44 C1.Util.FontSubSet.Init() +13 C1.Util.FontSubSet.GetFontSubSet(FontKey fk) +188 C1.C1Preview.C1PrintDocument.#o0c(String s, String fontName, Boolean fontBold, Boolean fontItalic, Boolean updateDocumentFonts) +104 C1.C1Preview.C1PrintDocument.#q0c(String s, String fontName, Boolean fontBold, Boolean fontItalic, Boolean updateDocumentFonts) +68 C1.C1Preview.Util.C1TextBase.AddText(C1PrintDocument document, String s, Style style, String fontName, Int32 fontGdiCharSet, C1Hyperlink hyperlink, C1LinkTarget linkTarget, Boolean drawing) +381 C1.C1Report.Field.#xtd(C1PrintDocument doc, String str, Int32 startIndex) +404 C1.C1Report.Field.#Vqd(Layout layout, String str, Image image, BarCodeEnum barCode, ShapeBase shape) +475 C1.C1Report.Field.Render(Layout layout, Double x, Double y, Boolean measure) +885 C1.C1Report.Field.#Gtd() +203 C1.C1Report.Section.Calculate(Boolean subreportsOnly) +488 C1.C1Report.Section.Render(Boolean keepPage, Group ownerGroup) +557 C1.C1Report.Layout.StartDoc() +573 C1.C1Report.C1Report.RenderFirstPass(Boolean releaseDocument) +219 C1.C1Report.C1Report.#avd() +34 C1.C1Report.C1Report.#8ud() +21 C1.C1Report.C1Report.Render() +4 Visicort.VIMS.UI.ReportViewer.Page_Load(Object sender, EventArgs e) +173 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +95 System.Web.UI.Control.LoadRecursive() +59 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678

    Any help fixing this would be much appreciated. Thanks Jonathan

  • Posted 19 May 2019, 8:49 pm EST

    Hi Jonathan, For information, the C1Report is obsolete and please use the FlexReport instead of C1Report as much as possible.

    Could you please the C1 version you are using? Please make sure that the C1 is installed on the server. The server is licensed for C1. It would be great if you may share a small demo sample depicting your issue.

    Regards, Manish Gupta

  • Posted 27 May 2019, 9:07 pm EST

    Hi C1Report version is 4.6.20142.54737. I have a webforms page with this markup:

    Report Viewer - VIMS

    The report is configured and filled with data in business layer and placed in a session variable. The following code executes in Page_Load event:

            protected void Page_Load(object sender, EventArgs e)
                if (Session["CurrentReport"] != null)
                    C1.C1Report.C1Report report;
                    report = (C1.C1Report.C1Report)Session["CurrentReport"];
                    System.IO.MemoryStream stream = new System.IO.MemoryStream();
                    HttpResponse rsp = this.Page.Response;
                    rsp.Buffer = true;
                    report.C1Document.Export(stream, 	  C1.C1Preview.Export.ExportProviders.PdfExportProvider);
                    rsp.ContentType = "application/pdf";
                    int length = Convert.ToInt32(stream.Length);
                    rsp.OutputStream.Write(stream.GetBuffer(), 0, length);
                    rsp.SuppressContent = true;

    Any help much appreciated. Jonathan Attree

  • Posted 29 May 2019, 6:23 pm EST

    Hello Jonathan, Thank you for your code and sorry for the inconvenience. C1Report uses the System.Drawing (GDI) for export process in various format which is not supported by the Azure App service. Please refer to the following link for reference:

    That is why you are getting the Runtime error for deployed application on Azure.

    Regards, Manish Gupta

  • Posted 28 March 2023, 7:51 pm EST

    Hi, Could I ask if this System.Drawing (GDI) problem has been resolved in recent versions

  • Posted 30 March 2023, 5:48 am EST


    We apologize for the inconvenience. This issue is still under investigation to remove GDI dependency.


    Manish Gupta

Need extra support?

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

Learn More

Forum Channels