MvcReportViewer icon indicating copy to clipboard operation
MvcReportViewer copied to clipboard

Get Error When Using Report Parameter

Open sky3913 opened this issue 6 years ago • 1 comments

I create a simple report with only one textbox and its value from parameter (=Parameters!Parameter1.Value).

I also create a simple report parameter, name: Parameter1, allow null and allow blank value.

Then in my view I show the report using this code: @Html.MvcReportViewerFluent("Report/rptTest.rdlc").ProcessingMode(ProcessingMode.Local).ReportParameters(new { Parameter1 = "Hello World!" })

After run, I get the error message: "Service unavailable!", and from the console "Microsoft.Reporting.WebForms.LocalProcessingException: An+error+occurred+during+local+report+processing."

If I remove the parameter and change with text, it will display the report.

How to solve this?

Here is the configuration in web.config: <MvcReportViewer reportServerUrl="" username="" password="" aspxViewer="~/MvcReportViewer.aspx" aspxViewerJavaScript="~/Scripts/MvcReportViewer.js" errorPage="~/MvcReportViewerErrorPage.html" showErrorPage="true" isAzureSSRS="false" encryptParameters="false" localDataSourceProvider="MvcReportViewer.SessionLocalDataSourceProvider, MvcReportViewer" />

sky3913 avatar Mar 08 '18 13:03 sky3913

It looks like you parameter hasn't been passed to the RDLC. Try to remove the report parameter from your rdlc and check that you can see the report. If it does not help, I'd suggest to debug the library's source code. I was tried to implement the issue using the code provided in the ticket, but everything works for me.

ilich avatar Mar 22 '18 13:03 ilich