Registering Data when Creating a New Report
Our sample projects and report templates can help you learn the basics of working with our products.When a user creates a new report in the designer, you can automatically register data for it through the onCreateReport event.
Preparing the data. Read or create the data source, register it in the report dictionary, synchronize the schema, and render with the supplied records.
The handler runs in the browser whenever a new report is created, registering a dataset and synchronizing the dictionary so authors always start with the right data available.
Preparing the data. Read or create the data source, register it in the report dictionary, synchronize the schema, and render with the supplied records.
$designer->onCreateReport = 'onCreateReport';
$designer->process();function onCreateReport(args) {
let dataSet = new Stimulsoft.System.Data.DataSet("Demo");
dataSet.readJson(jsonData);
args.report.dictionary.databases.clear();
args.report.regData("Demo", "Demo", dataSet);
args.report.dictionary.synchronize();
}onCreateReport = 'onCreateReport'— names the browser function that runs whenever the user creates a new report.readJson / regData— builds a dataset and registers it with the new report.dictionary.synchronize()— refreshes the data dictionary so the new fields are ready to use.
The handler runs in the browser whenever a new report is created, registering a dataset and synchronizing the dictionary so authors always start with the right data available.