Using Telerik.Reporting on Azure Web Site

8 posts, 0 answers
  1. James Strope
    James Strope avatar
    19 posts
    Member since:
    Mar 2009

    Posted 11 Nov 2016 Link to this post

    Hello,

    We have a web site hosted in Azure, and we are trying to add Telerik report generation to it. It works just fine when running in Visual Studio, but when we publish it to Azure and run it from there, we get the below error.  I realize this is a very generic question--I don't have a little test project that I can provide--but does this symptom sound familiar to anybody?  A known issue with deploying Telerik.Reporting to Azure, perhaps?

    Using Telerik Q1 2014.

    Method in Question:

                try
                {
                    var monthlyInvoice = new Reports.MonthlyInvoice(model);
                    var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
                    var generatedReport = reportProcessor.RenderReport("PDF", monthlyInvoice, null); //*** where it crashes
                    return generatedReport.DocumentBytes;
                }
                catch (Exception exp)
                {
                    Tracker.TrackError(exp, ErrorTrackerTags.Report, ErrorTrackerTags.Invoice);
                    return null;
                }

    The Error:

    Message: [ArgumentException: Parameter is not valid.]
     System.Drawing.Graphics.GetHdc():29
     Telerik.Reporting.Pdf.PdfContext..ctor():36
     Telerik.Reporting.Pdf.PdfDocument..ctor():38
     Telerik.Reporting.ImageRendering.DocumentPdf.FindOrCreateDocument():48
     Telerik.Reporting.ImageRendering.DocumentPdf..ctor(PdfRenderingContext context, IMeasureContext measureContext):15
     Telerik.Reporting.ImageRendering.PdfReport.CreateDocument(IDictionary renderingInfo, IDictionary deviceInfo, CreateStream createStreamCallback, PageSettings pageSettings):11
     Telerik.Reporting.BaseRendering.DocumentRenderingExtensionBase.CreateWriter(IDictionary renderingContext, IDictionary deviceInfo, CreateStream createStreamCallback, PageSettings pageSettings):0
     Telerik.Reporting.ImageRendering.PdfReport.CreateWriter(IDictionary renderingContext, IDictionary deviceInfo, CreateStream createStreamCallback, PageSettings pageSettings):0
     Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback):120
     Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback):388
     Telerik.Reporting.Processing.ReportProcessor.ProcessAndRender(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback):27
     Telerik.Reporting.Processing.ReportProcessor.ProcessAndRenderStateless(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback):0
     Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo):36
     Billing.Reporting.Generator.GenerateMonthlyInvoice(MonthlyInvoiceModel model):7

     

     

  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 14 Nov 2016 Link to this post

    Hello James,

    Please check if the used Azure plan has GDI+ support included. More details can be found in GDI+ error or OutOfMemoryException on exporting or printing Telerik report from Azure WebSites.



    Regards,
    Stef
    Telerik by Progress
    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 Feedback Portal and vote to affect the priority of the items
  3. James Strope
    James Strope avatar
    19 posts
    Member since:
    Mar 2009

    Posted 14 Nov 2016 Link to this post

    Thanks for the suggestion.  While looking into that, I actually found something else which turned out to be the culprit.  Our Azure environment had our app set to 32Bit instead of 64Bit.  Once I switched that, the report generated without error.

     

  4. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 14 Nov 2016 Link to this post

    Hi James,

    Thank you for this update.
    We will appreciate it if you share more details for other community members:
    1. Azure hosting plan;
    2. If exporting in PDF and XLS works;
    3. Project target platform;
    4. Azure hosting setting required by the application;


    Regards,
    Stef
    Telerik by Progress
    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 Feedback Portal and vote to affect the priority of the items
  5. ksafadi
    ksafadi avatar
    11 posts
    Member since:
    Oct 2012

    Posted 20 Dec 2019 in reply to Stef Link to this post

    Same for me. Setting Azure to 64 Bit in Configuration -> General settings resolved the issue for me.
  6. Ivan Hristov
    Admin
    Ivan Hristov avatar
    227 posts

    Posted 24 Dec 2019 Link to this post

    Hello Karim,

    Thank you for sharing this information. Indeed changing the platform from 32 to 64 bit should not affect the rendering process, but it seems the 64-bit version of Azure environment includes the GDI+ routines needed for report processing. Hopefully this information will help all of our users that have troubles using Telerik Reporting on Azure.

    Regards,
    Ivan Hristov
    Progress Telerik

    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 Feedback Portal and vote to affect the priority of the items
  7. Mitch Thraves
    Mitch Thraves avatar
    21 posts
    Member since:
    Feb 2006

    Posted 15 Jan Link to this post

    Over the past few years we have been moving away from using Telerik Reporting as our hosting was with Azure and they didn't seem to play very well together.

    The GDI+ issue seems to have been resolved, but can you give me some guidance regarding multiple instances.

     

    We have previously avoided Scaling out our application to multiple instances due to Telerik Reporting not working very well with a multiple instance setup due to the reports sometimes being generated on a different instance.

    Do you have any advice on how to get Telerik Reporting working in an Azure multi instance setup?

    Many thanks

     

     

  8. Ivan Hristov
    Admin
    Ivan Hristov avatar
    227 posts

    Posted 17 Jan Link to this post

    Hi Mitch,

    You are correct, our reporting engine doesn't play well with any platform that lacks the GDI+ functionalities. Thankfully, this graphics library gets supported in increasing number of Azure service types. We have our demo application hosted on Standard Service Plan, but it should work as expected on Basic as well. As far as I know, the GDI+ is not supported only in Shared and Free service plans.

    About the scalability of our engine: in the last releases we introduced an improved way of queuing the reports for processing by the REST service and have fixed a few issues related with scenarios that involve multiple instances. Currently we're not aware of any issues on that matter, as long as the recommendations for the REST Service Storage are met. If I understand correctly the current scenario, the multiple instances of the REST Service must use the same storage instance (MSSQL or Redis database), so the report retrieval would work correctly.

    It will be really helpful for us if you decide to download the latest version of our product, give it a try in Azure environment and share your findings. In case you need support along the way, please do not hesitate to ask.

    Regards,
    Ivan Hristov
    Progress Telerik

    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 Feedback Portal and vote to affect the priority of the items
Back to Top