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

Multivalue Parameter Help

1 Answer 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael Love
Top achievements
Rank 1
Michael Love asked on 19 Nov 2009, 08:00 PM

Hi there.

I have a multivalued parameter called of type int called "Person". With that in mind, I have 2 questions:

1. How do I pull the data out programmatically? Basically, I want to do something like this:

foreach (int personId in (List)this.ReportParameters["Person"].Value)
{
    myList.Add(personId);
}

I can't quite figure out how to get at the collection and extract the values.

2. Along those same lines, how would I programmatically populate a multivalue parameter?

Thanks, Mike

1 Answer, 1 is accepted

Sort by
0
Michael Love
Top achievements
Rank 1
answered on 20 Nov 2009, 03:02 PM
I actually figured out getting the data. I did this:

 

var list = new List<long>();

 

 

// Populate list from Person parameter to user in contains statement when getting datasource

 

 

foreach (int personId in (System.Collections.ArrayList)this.ReportParameters["Person"].Value)

 

{

list.Add((

long)personId);

 

}

Mike

Tags
General Discussions
Asked by
Michael Love
Top achievements
Rank 1
Answers by
Michael Love
Top achievements
Rank 1
Share this question
or