Reputation: 1312
I have a queue-triggered Azure Function which takes an ID, runs a SQL query using that ID, puts the results of the query in a DataTable and passes the DataTable to Telerik Reporting to generate a PDF.
When running, the following error is thrown from within Telerik:
Parameter is not valid.
at System.Drawing.Graphics.GetHdc()
at Telerik.Reporting.Pdf.PdfContext..ctor()
at Telerik.Reporting.Pdf.PdfDocument..ctor()
at Telerik.Reporting.ImageRendering.DocumentPdf.FindOrCreateDocument()
at Telerik.Reporting.ImageRendering.DocumentPdf..ctor(PdfRenderingContext context, IMeasureContext measureContext)
at Telerik.Reporting.ImageRendering.PdfReport.CreateDocument(IDictionary renderingInfo, IDictionary deviceInfo, CreateStream createStreamCallback, PageSettings pageSettings)
at Telerik.Reporting.BaseRendering.DocumentRenderingExtensionBase.CreateWriter(IDictionary renderingContext, IDictionary deviceInfo, CreateStream createStreamCallback, PageSettings pageSettings)
at Telerik.Reporting.ImageRendering.PdfReport.CreateWriter(IDictionary renderingContext, IDictionary deviceInfo, CreateStream createStreamCallback, PageSettings pageSettings)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
at Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRender(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRenderStateless(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo)
The folks at Telerik suggested this: http://www.telerik.com/support/kb/reporting/details/outofmemoryexception-on-exporting-or-printing-telerik-report-from-azure-websites however I can't see a way to apply these settings to an Azure Function (assuming that is relevant to the problem).
Anyone been successful in producing a PDF from Azure Functions or have any pointers on what to try next?
Upvotes: 0
Views: 1142
Reputation: 577
Can the SSRS ReportViewer control be used in Consumption Plan in an Azure Function? I'd probably call the C# dll that has that from the .csx? And if so how do you do it with the new visual studio 2015 preview tools that were release yesterday?
Upvotes: 0
Reputation: 12538
Drew, GDI+ is indeed restricted in the sandbox. Are you running on the consumption plan? The document does state that you'd need to be running on basic or standard tiers.
Also, with Azure Functions, you don't currently have access to the web.config
file, so if you need to make the modification they recommend (for some PDF features), that would be a limitation you wouldn't be able to work around at the moment.
Upvotes: 1