I am using Report Builder and loading the report in c#, also setting some parameters in c# too:
My question is, how do I set a ReportParameter of multiple integer values when I have it stored in an array?
I have tried the following:
MyReportViewer.ServerReport.SetParameters(
new ReportParameter("storeSelected", new int[3]{2,3,4}, false)
);
However, this does not work, because ReportParameter does not take int.
I have also tried the following:
MyReportViewer.ServerReport.SetParameters(
new ReportParameter("storeSelected", new int[3]{"2", "3", "4" }, false)
);
This also does not work as my parameter "storeSelected" is of type int, and will throw a type conversion error.
What do I need to do to pass my array of integer into the reportParameter?
Based on the documentation by Microsoft, this line of code should read:
MyReportViewer.ServerReport.SetParameters(
new ReportParameter("storeSelected", new string[] { "2", "3", "4" }, false)
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With