How to Pass Variables from JavaScript code to a report

Stimulsoft Reports.JS discussion
Post Reply
Ali.Salamat
Posts: 2
Joined: Tue Aug 02, 2016 3:22 am

How to Pass Variables from JavaScript code to a report

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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
Ali.Salamat
Posts: 2
Joined: Tue Aug 02, 2016 3:22 am

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

Post by Ali.Salamat »

thanks for your help but Sorry your code didn't help me
could you please make small example with my code?????
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

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