This example illustrates loading of the report and load Json-data, data rendering and saving the result to the mdc-file.

Installation and running
Use npm to install requred modules:
$ npm install
Run Sample:
$ npm start

Step by step
Stimulsoft Reports.JS module loading:
var Stimulsoft = require('stimulsoft-reports-js');
Creating a new report:
var report = new Stimulsoft.Report.StiReport();
Loading sample report template:
report.loadFile("SimpleList.mrt");
Remove all connections from the report template
report.dictionary.databases.clear();
Create new DataSet object:
var dataSet = new Stimulsoft.System.Data.DataSet("Demo");
Load JSON data file from specified URL to the DataSet object:
dataSet.readJsonFile("Demo.json");
Remove all connections from the report template:
report.dictionary.databases.clear();
Register DataSet object:
report.regData("Demo", "Demo", dataSet);
Renreding report and saving rendered report to mdc-file:
report.renderAsync(function () {

    // Saving rendered report to file
    report.saveDocumentFile("SimpleList.mdc");
});

Auf dem Screenshot unten Sie können das Ergebnis des Beispiel-Codes ansehen:

Loading a Report Template and Rendering it with a JSON Data

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.