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