ilich / MvcReportViewer

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

Use external dropdown value to generate report #211

Closed pauljame closed 7 years ago

pauljame commented 7 years ago

Hello,

I have a view with a external dropdown. The user will select a value and select "Show report".

Can I do that with MvcReportViewer ? Maybe adding a prameter in js? But how ?

Thanks

ilich commented 7 years ago

Hello,

You should create a Model where you will store the parameter. Once user clicks Show report, there will be a POST request to the server. You will fill captured values in the Model and pass them to the report viewer HTML helper.

I think it will be the simplest solution.

pauljame commented 7 years ago

Thanks for the reply

But how can I pass that value to report viewer HTML helper?

Thanks

ilich commented 7 years ago

You can use report parameters, e.g. @Html.MvcReportViewer( "/Reports/TestReport", new { Parameter1 = "Hello World!", Parameter2 = DateTime.Now, Parameter3 = 12345 }, new { Height = 900, Width = 900, style = "border: none" })