How to set variables by code-behind (JS)

Stimulsoft Reports.JS discussion
Post Reply
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

How to set variables by code-behind (JS)

Post by hugo »

Hello,

How to set variables by code-behind (JS).

I do this with my current FX version:

Code: Select all

for each (var variable:StiVariable in report.dictionary.variables)
{
	variable.valueObject = ....
}
How to do the same with JS ?
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: How to set variables by code-behind (JS)

Post by Vladimir »

Hello Hugo,

Please try to use the following code:

Code: Select all

report.dictionary.variables.list.forEach(function(item, i, arr) {
    item.valueObject = ...
});
or

Code: Select all

for (var i = 0; i < report.dictionary.variables.list.length; i++) {
    report.dictionary.variables.list[i].valueObject = ...
}

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: How to set variables by code-behind (JS)

Post by hugo »

Thank you.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to set variables by code-behind (JS)

Post by HighAley »

Hello.

We are always glad to help you.

Thank you.
Post Reply