Binding Data to a Report with StiJsonDatabase

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

Binding Data to a Report with StiJsonDatabase

Post by Loki87 »

Hello Stimulsoft,

I am using for Data Binding to a Report the following code:

var jsonDataBase = new Stimulsoft.Report.Dictionary.StiJsonDatabase("test", "data/usersdata.json");

with a json File its working correctly, the report is rendering an showing the Data correctly, but I don't want to use json File,
I want to use Data from my Database, so I put the data in a json Object, my question is: is there a way to use the json object in this code like:

var jsonDataBase = new Stimulsoft.Report.Dictionary.StiJsonDatabase("test", json_obj);
I have tried this but it is not working, is there another way to Bind an json_obj that is like the json File.

I am using the Stimulsoft JS version 2016.02.05

best regards
Loki
peda
Posts: 39
Joined: Fri Feb 12, 2016 9:24 am

Re: Binding Data to a Report with StiJsonDatabase

Post by peda »

Hi i use this and it works perfekt


var dataSet = new Stimulsoft.System.Data.DataSet("invoice");
dataSet.readJson(reportdata);
report.regData(dataSet.dataSetName, "", dataSet);

Regards Peter
Loki87
Posts: 19
Joined: Thu Dec 10, 2015 1:17 pm

Re: Binding Data to a Report with StiJsonDatabase

Post by Loki87 »

Thank you for your reply,
I have found the Problem, it was the definition of my sql result, I have changed and it is working!!!!

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

Re: Binding Data to a Report with StiJsonDatabase

Post by HighAley »

Hello.

The StiJsonDatabase is for internal use.
Please, use code provided by peda.

Thank you.
Post Reply