This should be simple process but now it became annoying issue.
I am trying to pass multiple value in query string in my ASP.Net web report in VS2012. The page has to pass multiple values to the report as a parameter . When I sent a single value (for eg: abc,) the data is being pulled up correctly but however when I am passing multiple values separated by a comma (eg abc,xyz) it is not displaying the results These multiple values separated by a comma are being passed to the page as query strings and we then are reading them and passing it to the report.
Please note:
For the parameter in the report, I set the default list of values and I also defined available set of values. Now when I am trying to trying pass the values to this parameter from c# code, it is still not accepting the values that I supplied instead it is taking all the values from available list. I think the problem is that the SSRS is not accepting values separated by a comma when "Allow multiple values" check box is checked. Please advise.
This is what I am trying so far:
ReportParameter pb1 = new ReportParameter();
if (!string.IsNullOrEmpty(Request.QueryString["pm1"])) {
pb1.Name = "PurchaseMaterial1";
string[] strPb1 = Server.UrlDecode(Request.QueryString["pm1"]).Split(',');
string value = Server.UrlDecode(Request.QueryString["pm1"]);
if (strPb1.Length > 0)
{
int i = 0;
value = "";
while (i < strPb1.Length)
{
if (value == string.Empty)
{
value = "'" + strPb1[i] + "'";
}
else
{
value += ",'" + strPb1[i] + "'";
}
i += 1;
}
}
pb1.Values.Clear();
pb1.Values.Add(value);
Please help, thanks much in advance:)