This is a migrated thread and some comments may be shown as answers.

Using Telerik.Reporting on Azure Web Site

7 Answers 485 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
James Strope
Top achievements
Rank 1
James Strope asked on 11 Nov 2016, 09:07 PM

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

 

 

7 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 14 Nov 2016, 10:42 AM
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
0
James Strope
Top achievements
Rank 1
answered on 14 Nov 2016, 03:18 PM

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.

 

0
Stef
Telerik team
answered on 14 Nov 2016, 03:23 PM
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
0
ksafadi
Top achievements
Rank 1
answered on 20 Dec 2019, 10:12 AM
Same for me. Setting Azure to 64 Bit in Configuration -> General settings resolved the issue for me.
0
Ivan Hristov
Telerik team
answered on 24 Dec 2019, 03:42 PM

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
0
Mitch Thraves
Top achievements
Rank 2
answered on 15 Jan 2020, 04:10 PM

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

 

 

0
Ivan Hristov
Telerik team
answered on 17 Jan 2020, 11:41 AM | edited on 26 Oct 2021, 09:10 AM

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 an 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 to 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 the 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
Tags
General Discussions
Asked by
James Strope
Top achievements
Rank 1
Answers by
Stef
Telerik team
James Strope
Top achievements
Rank 1
ksafadi
Top achievements
Rank 1
Ivan Hristov
Telerik team
Mitch Thraves
Top achievements
Rank 2
Share this question
or