ilich / MvcReportViewer

ASP.NET MVC Html Helpers for ReportViewer Control.
MIT License
282 stars 131 forks source link

Get Error When Using Report Parameter #220

Open sky3913 opened 6 years ago

sky3913 commented 6 years ago

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" />

ilich commented 6 years ago

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.