I'm migrating simple ASP Web API to Azure Functions, for the first time. The function will take some JSON input, and creates a PDF report with Microsoft.Reporting.WebForms.
Unfortunatly, I get the following error:
Exception while executing function: Functions.HttpTriggerCSharp1. Microsoft.ReportViewer.WebForms: An error occurred during local report processing. Microsoft.ReportViewer.Common: The definition of the report 'D:\home\site\wwwroot\HttpTriggerCSharp1\bin\Test.rdlc' is invalid. Microsoft.ReportViewer.Common: An unexpected error occurred in Report Processing. Microsoft.ReportViewer.Common: The type initializer for 'Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatVersion' threw an exception. mscorlib: The path is not of a legal form.
First I thought that the .rdlc file was not found, but that doens't seems to be the case. It finds the file, but can't handle it, so it seems.
I'm calling the file via:
ReportViewer rv = new ReportViewer();
rv.ProcessingMode = ProcessingMode.Local;
rv.LocalReport.ReportPath = Path.Combine(System.Environment.GetEnvironmentVariable("HOME"), @"site\wwwroot\HttpTriggerCSharp1\bin\Test.rdlc");
I've searched a lot, but can't find specifics on Azure Functions and ReportViewer. Maybe I'm missing something, or I'm trying something that's not possible. Thanks in advance.