Multi-value SSRS report parameters from C#

If you are calling SSRS reports from C# and setting the parameters programatically you will sooner or later come across a case where you have to assign a parameter with multiple values. This problem proved quite vexing but I have found the (rather simple) solution so here it is:

string[] foobarValues = new string[] { "foo", "bar", "rnd" };

//Create the list of parameters that will be passed to the report
List reportParameters = new List();

//Set up the multi-value parameter and add the foobarValues array to it
ReportParameter multiValueParam = new ReportParameter("foobar");

//Finally we add the multi-value parameter to our main parameter list

//Set the ReportViewers parameters to the list of ReportParameters we just created

And that is it. Plain and simple. :)


Now read this

Application Insight for C# WPF

Note See an updated Application Insight client post on my new blog There is a lot of talk about Microsoft’s Application Insight platform and rightly so, it is an amazing tool for gathering and analyzing application telemetry with a... Continue →