Variable string List sample

Stimulsoft Reports.WPF discussion
Post Reply
JorisWils
Posts: 86
Joined: Tue Jun 30, 2009 7:49 am
Location: belgium

Variable string List sample

Post by JorisWils »

Hi

I noticed the "list" option in the "new variable"-form.
Is that, for example, a string array?
If it is an array... can it be multi-dimensional?

Are there sample reports on how to add, remove and read listitems from that list in the report from an event?

Is it also possible to populate that list when declaring the variable by using the "expression" option?


My question in short: How does it work? :-)
Using Stimulsoft since 2007
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Variable string List sample

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

report.Dictionary.Variables["VariableName"].DialogInfo.GetDialogInfoItems(typeof(StringList));
Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Variable string List sample

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

report.Dictionary.Variables["VariableName"].DialogInfo.GetDialogInfoItems(typeof(StringList));
Thank you.
JorisWils
Posts: 86
Joined: Tue Jun 30, 2009 7:49 am
Location: belgium

Variable string List sample

Post by JorisWils »

Thx a lot. That helped me on my way.

For anyone who wants to do things like this:
I was looking to add values in events whitin a report so I could just make the variable in designer and add values using this code:

Code: Select all

stringlistvariable.Add("myNewString");
I could check for the existance of a value by using:

Code: Select all

stringlistvariable.Contains("myNewString")
And get the index of a certain value by using:

Code: Select all

stringlistvariable.IndexOf("myNewString")
Using Stimulsoft since 2007
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Variable string List sample

Post by Andrew »

Hello,

Thank you for sharing your knowledge with other users.

Post Reply