How to set a StringList variable by code?

Stimulsoft Reports.JS discussion
Post Reply
Barnaby
Posts: 27
Joined: Tue Dec 20, 2016 1:57 am

How to set a StringList variable by code?

Post by Barnaby »

Hey,

How do you set the value for the following variable?
StringListVariable.png
StringListVariable.png (10.98 KiB) Viewed 1889 times

I've tried a few things, but with no success. Eg

Code: Select all

report.dictionary.variables.getByName("Test").valueObject = "A";
report.dictionary.variables.getByName("Test").valueObject = ["A"];

Thanks,
Barnaby.
Barnaby
Posts: 27
Joined: Tue Dec 20, 2016 1:57 am

Re: How to set a StringList variable by code?

Post by Barnaby »

I've found one that works

Code: Select all

viewer.report.setVariable("Test", ["A"]);

Only issue is that it doesn't update the Paramaters Panel with the selected values. Is there a correct way to do this?
Lech Kulikowski
Posts: 7289
Joined: Tue Mar 20, 2018 5:34 am

Re: How to set a StringList variable by code?

Post by Lech Kulikowski »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.
Post Reply