Page 1 of 1

Change Text Value by code

Posted: Tue Jun 06, 2017 7:03 pm
by ricardolb
Hello there, I'm testing Stimulsoft reports for javaScript, I would like to know if I can
change the value of a Text component inside a Report by code, how can I do that?

Thanks in advance..

Re: Change Text Value by code

Posted: Thu Jun 08, 2017 12:20 am
by Edward
Hi Ricardo,

If you define a variable var1 in the Report Dictionary and if you add this variable into the Text Component as follows:

Code: Select all

{var1}
then you could change the value of this variable from the code as follows:

Code: Select all

report.dictionary.variables.getByName("var1").valueObject = "your value";
Thank you,
Edward

Re: Change Text Value by code

Posted: Thu Jun 08, 2017 12:07 pm
by ricardolb
Hi Edward, thanks for your reply, I used a different approach, creating a Text component in Runtime.

It worked!

Thanks,
Ricardo

Re: Change Text Value by code

Posted: Fri Jun 09, 2017 4:36 am
by Andrew
Hello,

Great! Thank you for letting us know about this.

Have a nice day!