Page 1 of 1

how to bind a data source json to report

Posted: Fri Jan 24, 2020 12:12 am
by edcaron
Hi.

I want to bind a datasource to my Report on Reports designer.

How do i do that using Javacript? I haven't found docs for datasource binding.

What i found is the following code, but the datasource wont appear on the screen. It just appears after i add another manually using the interface. Its like I'm missing a "refresh" command.

Code: Select all

// Create new DataSet object
var dataSet = new Stimulsoft.System.Data.DataSet("teste123");
// Load JSON data file from specified URL to the DataSet object
dataSet.readJsonFile("files/reports/SimpleData.json");
// Remove all connections from the report template
report.dictionary.databases.clear();
// Register DataSet object
report.regData("teste123", "teste123", dataSet);
report.dictionary.synchronize();

Re: how to bind a data source json to report

Posted: Sat Jan 25, 2020 11:53 am
by Lech Kulikowski
Hello,

Please check the following article:
https://www.stimulsoft.com/en/documenta ... _files.htm

Thank you.