Page 1 of 1

How to Pass Variables from JavaScript code to a report

Posted: Tue Aug 02, 2016 5:35 am
by Ali.Salamat
Hi to All

we are using a windows tool software that enable us to run some JavaScript code as module inside of the tool
so we want to pass some variable ( some text values) through this tool ( run as JavaScript Code ) to our Stimul Report

our Windows Tool > Run and Pass Some parameters through JavaScript Code > show this parameters on report


for example I have a simple Code in JavaScript (this Code saved in our tool ) as below :
and I have Some Limitation

1- the first one I should use JavaScript Code in one tool
2- we cannot put our code in Web Server . Should be run as Stand alone.

//---------------------------------- Java Script Code -------------------------------------------------
var header = "Title of the Slide ~~"
var args = (
"Question 1~~" + " Answer 1 " +
"~~Question 2~~" + " Answer 2 " +
"~~Question 3~~" + " Answer 3 "
)
window.open(url, "_blank", "width=800,height=600,menubar=no");

//---------------------------------- Java Script Code -------------------------------------------------

So my Questions :

1- How I can pass variables or parameters from JavaScript Code to StimulReport ?
2- How I can Pass Array to the report?

Could you please put for me small sample for my code???( with at least 2 parameters )

I'm using trial version
Thanks for your help

Re: How to Pass Variables from JavaScript code to a report

Posted: Tue Aug 02, 2016 12:30 pm
by HighAley
Hello.

You could set the value of variable with next code:

Code: Select all

report.dictionary.variables.getByName("var1").valueObject = "your value";
You could use list variables to pass several values there.

Thank you

Re: How to Pass Variables from JavaScript code to a report

Posted: Tue Aug 02, 2016 2:10 pm
by Ali.Salamat
thanks for your help but Sorry your code didn't help me
could you please make small example with my code?????

Re: How to Pass Variables from JavaScript code to a report

Posted: Wed Aug 03, 2016 2:23 pm
by HighAley
Hello.

Sorry, we don't understand where and how you use your code.
Could you describe your issue more detailed and send as a sample.

Thank you.