how to bind a data source json to report

Stimulsoft Reports.JS discussion
Post Reply
edcaron
Posts: 6
Joined: Sat Aug 17, 2019 5:57 pm

how to bind a data source json to report

Post 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();
Lech Kulikowski
Posts: 7292
Joined: Tue Mar 20, 2018 5:34 am

Re: how to bind a data source json to report

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply