ilich / MvcReportViewer

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

Passing URL Parameters into the report #189

Closed Logicaled closed 7 years ago

Logicaled commented 7 years ago

Is it possible to accept parameter values from a url string to a hosted report on a mvc site, using this report viewer tool?

Thanks

ilich commented 7 years ago

First, you should create parameters in the report. Then you parse URL and add the parameters to Enumerable<KeyValuePair<string, object>> property on your model. The last step is to render your report using @Html.MvcReportViewer(string reportPath, IEnumerable<KeyValuePair<string, object>> reportParameters, object htmlAttributes) helper method or a similar method using accepting Enumerable<KeyValuePair<string, object>> arument.