This is a migrated thread and some comments may be shown as answers.

About retriving multivalues parameter

1 Answer 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ciccio
Top achievements
Rank 1
ciccio asked on 15 Jun 2011, 10:32 AM
Hi,
about this subject i have read some trhead in this forum but  could'nt find a solution for my problem.

Here the problem:
i manage the parameter by the build in Ui for parameter, My parameter is setted as multivalues.
Now i would like to get  the values  choosen by the user.

Documetation and intellisense, about ReportParameter.value property, says :
"Gets or sets the value of the parameter. Can be an Expression that evaluates to an object, value of the allowed types, or [!:IEnumerable] containing values of the allowed types. "

But ReportParameter.value  is an object and does'nt expose an enumerator. In same place i read it is an ArrayList so i tried something like that:
ArrayList kl= new ArrayList();
 kl =Report.ReportParameters[0].Value;

and i get the above error:
Unable to cast object of type 'System.Object[]' to type 'System.Collections.ArrayList'.

No matter what typ of collection i tried with( Ilist,List). I get always a casting error.

So i can retrieve the list of values of a multivalues parameter?

Thanks




1 Answer, 1 is accepted

Sort by
0
ciccio
Top achievements
Rank 1
answered on 15 Jun 2011, 10:47 AM

Ok, i have the solution.....:(

IEnumerable kl;
             kl =(IEnumerable)Report.ReportParameters[0].Value;
Tags
General Discussions
Asked by
ciccio
Top achievements
Rank 1
Answers by
ciccio
Top achievements
Rank 1
Share this question
or