Path to JSON Data editing via Code

Stimulsoft Reports.JS discussion
Post Reply
Loki87
Posts: 19
Joined: Thu Dec 10, 2015 1:17 pm

Path to JSON Data editing via Code

Post by Loki87 »

Hello,

is there a way after loading the report , to edit the Path to the JSON Data in the DataSource of the Report via code in js???
I know how to give the Path a Parameter in the designer and setting a value to a variable from code so the Data is loading correctly, but I need a way to set the Path in Code so it can take the parameter/variable

Path to JSON Data: http://stimulsoft.com/data/{Variable/Parameter I want to Set in Code}

Best regards

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

Re: Path to JSON Data editing via Code

Post by HighAley »

Hello, Loki.

You could use next code to change the path to JSON:

Code: Select all

report.dictionary.databases.getByIndex(0).pathData = "newPath";
Thank you.
Loki87
Posts: 19
Joined: Thu Dec 10, 2015 1:17 pm

Re: Path to JSON Data editing via Code

Post by Loki87 »

Hello HighAley,

thank you very much, it's working.
Loki87
Posts: 19
Joined: Thu Dec 10, 2015 1:17 pm

Re: Path to JSON Data editing via Code

Post by Loki87 »

Hello,

I have another question regarding the Path, how can I set the Path to JSON data via code if there isn't defined one before???

best regards

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

Re: Path to JSON Data editing via Code

Post by HighAley »

Hello.

You could find sample code how to create a report with JavaScript code in the Stimulsoft KnowledgeBase.

Thank you.
Post Reply