Page 1 of 1

showing user-modifed list variables in report

Posted: Thu Jun 16, 2011 2:59 am
by Jozef Balga
Hello!

I generate reports from external C# code. I defined long list type variables in the report and the default values for these variables are taken from database columns. I am able to set these variables using the following code:

Code: Select all

report.Dictionary.Variables["longListVar"].ValueObject = "new LongList() { 2 };";
I also defined custom methods in my report which convert these lists variables to strings so I can display the list elements. Unfortunately I can not see the modified list values in the generated report, the default (database column) values are shown. I use the following expression to show the list values

Code: Select all

{getLongListString(longListVar)}
where getLongListString() is my method which accepts a long list variable. How should I modify my report or the generating code to show the modified variables?
Thank You for the answer.

Jozef

showing user-modifed list variables in report

Posted: Thu Jun 16, 2011 4:37 pm
by Ivan
Hello,

Can you please send us a sample report template with data or a simple test project, which reproduce the issue?

Thank you.

showing user-modifed list variables in report

Posted: Fri Jun 17, 2011 6:51 am
by Jozef Balga
Hi!
The sample project with the report generating code has been added. It connects to a MySQL database, but manipulates with the data from the DUAL table.
The report contains
-text field which displays the long list variable elements as string using a converter method
-data band which displays filtered values from the database : the same converter function is used in the SQL query.

showing user-modifed list variables in report

Posted: Mon Jun 20, 2011 4:41 am
by Alex K.
Hello,

As a way, in this case, you can use the following code:

Code: Select all

string[] list = { "2" };
report.Dictionary.Variables["ListVariable"].DialogInfo.ItemsInitializationType = Stimulsoft.Report.Dictionary.StiItemsInitializationType.Items;
report.Dictionary.Variables["ListVariable"].DialogInfo.Values = list;
report.Dictionary.Variables["ListVariable"].DialogInfo.Keys = list;
Thank you.