showing user-modifed list variables in report

Stimulsoft Reports.NET discussion
Post Reply
Jozef Balga
Posts: 56
Joined: Fri May 27, 2011 8:33 am
Location: Bratislava, Slovakia

showing user-modifed list variables in report

Post 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
Attachments
1087.sample_project.zip
(3.18 KiB) Downloaded 365 times
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

showing user-modifed list variables in report

Post 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.
Jozef Balga
Posts: 56
Joined: Fri May 27, 2011 8:33 am
Location: Bratislava, Slovakia

showing user-modifed list variables in report

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

showing user-modifed list variables in report

Post 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.
Post Reply