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?
However this doesn't work
Mean..? what are you seeing vs what are you expecting. Take a look at this MSDN site it appears you are no passing theReportParams[]
properly msdn.microsoft.com/en-us/library/ms252178%28v=vs.80%29.aspx – Cindacindeenew ReportParameter("storeSelected", new[]{"2","3","4"}, false)
. – Thimblefulnew int[]{"1","2","3"}
) and what I'm suggesting (new[]{"1","2","3"}
). – Thimbleful