wint100
asked on
How can I pass multiple parameter values to Reporting Services Report c#
I have the code below to programatically render a report in Reporting Services 2008 and pass the parameters needed.
One of the parameters can accept multiple values. How can I pass these from the C# code? I've tried passing Comma seperated values (1, 2, 2 etc), but is throws an exception.
The parameters are selected from an SQL database in varchar(50) format.
One of the parameters can accept multiple values. How can I pass these from the C# code? I've tried passing Comma seperated values (1, 2, 2 etc), but is throws an exception.
The parameters are selected from an SQL database in varchar(50) format.
if (_parameters.Length > 0)
{
parameters[0] = new BECScheduler.rsExecService.ParameterValue();
parameters[0].Label = "";
parameters[0].Name = "SDate";
parameters[0].Value = sDate;
parameters[1] = new BECScheduler.rsExecService.ParameterValue();
parameters[1].Label = "";
parameters[1].Name = "EDate";
parameters[1].Value = eDate;
parameters[2] = new BECScheduler.rsExecService.ParameterValue();
parameters[2].Label = "";
parameters[2].Name = "TLInstance1";
parameters[2].Value = TLInstance1;
parameters[3] = new BECScheduler.rsExecService.ParameterValue();
parameters[3].Label = "";
parameters[3].Name = "TLInstance2";
parameters[3].Value = TLInstance2;
}
How did you try passing in the list?
Like this?
(and for the record - I haven't had to do this before, but I'm just thinking about how SSRS understands multivalue parameters)
parameters[3] = new BECScheduler.rsExecService .Parameter Value();
parameters[3].Label = "";
parameters[3].Name = "TLInstance2";
parameters[3].Value = "1, 2, 3";
Like this?
(and for the record - I haven't had to do this before, but I'm just thinking about how SSRS understands multivalue parameters)
parameters[3] = new BECScheduler.rsExecService
parameters[3].Label = "";
parameters[3].Name = "TLInstance2";
parameters[3].Value = "1, 2, 3";
ASKER
Yes thats right, with comma then a space before the next value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can set Values property.
This linkj give you more detail.
http://msdn.microsoft.com/en-us/library/ms251764(VS.80).aspx