The code below gets the values I have entered for my report parameters in a Windows interface I have written for SSRS. However this only works for parameters that do not allow MultiValue. Since Parameter.Value is a string, I don't know how to assign multivalue to it.
private RE2005.ParameterValue[] GetParamValueSettings()
{
var parameters = new RE2005.ParameterValue[_Parameters.Count()];
for (int i = 0; i < _Parameters.Count(); i++)
{
parameters[i] = new RE2005.ParameterValue();
parameters[i].Name = _Parameters[i].Name;
**parameters[i].Value = pnlParams.Controls[_Parameters[i].Name].Text;**
}
return parameters;
}
For the line in bold above I did try this as a test: parameters[i].Value = "A,B,C"; (those are valid values)
But the report Throws an error saying that it needs valid values. In the report this is how I display it: = Join(Parameters!myParameter.Value, ", ")
Any advice appreciated, thanks!
with visual studio 2010, you can initialise the Report parameter with a string array.
with 2005 you may have to add the parameter in multiple times with the same name, but a new value.
This is a proc that would get parameters for a report if there was only one multivalued parameter.