Runtime error with C1Report on Azure website

Posted by: jonattree on 17 May 2019, 6:02 am EST

    • Post Options:
    • Link

    Posted 17 May 2019, 6:02 am 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 20 May 2019, 5:49 am 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 28 May 2019, 6:07 am 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.Render();
                    report.C1Document.Export(stream, 	  C1.C1Preview.Export.ExportProviders.PdfExportProvider);
    
                    rsp.Clear();
                    rsp.ContentType = "application/pdf";
                    int length = Convert.ToInt32(stream.Length);
                    rsp.OutputStream.Write(stream.GetBuffer(), 0, length);
                    rsp.Flush();
                    rsp.SuppressContent = true;
                    Session.Remove("CurrentReport");
                }
            }
    
    

    Any help much appreciated.

    Jonathan Attree

  • Posted 30 May 2019, 3:23 am 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:

    https://feedback.azure.com/forums/169385-web-apps/suggestions/12864567-support-for-gdi

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

    Regards,

    Manish Gupta

  • Posted 29 March 2023, 4:51 am EST

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

  • Posted 30 March 2023, 2:48 pm EST

    Hi,

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

    Regards,

    Manish Gupta

  • Posted 31 August 2023, 4:09 am EST

    Hi,

    This issue has been fixed internally and will be included in our next release. We will update you regarding this when the build gets officially released.

    Regards,

    Avinash

  • Posted 23 May 2024, 6:37 am EST

  • Posted 27 May 2024, 8:19 am EST

    Hi Marija,

    We are investigating on this issue. I will get back to you as soon as I have any updates on the case.

  • Posted 29 May 2024, 5:50 am EST

    Hi Mary,

    The original topic seems to be only concerned with with C1Reports however as you have mentioned on your forum post you are facing this issue with C1FlexReport. I would suggest you to wait for our update on the original forum post: https://developer.mescius.com/forums/c1-studio/c1-web-api-report-flex-report-error-on-azure

Need extra support?

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

Learn More

Forum Channels