Page 1 of 1

Binding Data to a Report with StiJsonDatabase

Posted: Tue Feb 16, 2016 8:41 am
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

Re: Binding Data to a Report with StiJsonDatabase

Posted: Tue Feb 16, 2016 9:26 am
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

Re: Binding Data to a Report with StiJsonDatabase

Posted: Tue Feb 16, 2016 1:28 pm
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

Re: Binding Data to a Report with StiJsonDatabase

Posted: Tue Feb 16, 2016 1:41 pm
by HighAley
Hello.

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

Thank you.