Register JSON String and Synchronize Dictionary
Our sample projects and report templates can help you learn the basics of working with our products.Data can be registered from a JSON string you have already fetched — for example from a REST API — and the report's dictionary synchronized to it.
Fetch JSON, then register and synchronize.
How it works. The report binds to data you fetched yourself, so it works with any REST endpoint or in-memory JSON without the engine issuing its own request.
Fetch JSON, then register and synchronize.
var report = new Stimulsoft.Report.StiReport();
fetch('../reports/Demo.json')
.then(response => response.json())
.then(result => {
var dataStr = JSON.stringify(result);
report.loadFile('../reports/SimpleListEmptyDictionary.mrt');
report.regJsonData('Demo', dataStr, true); // true = synchronize dictionary
viewer.report = report;
});regJsonData(name, jsonString, synchronize)— registers an already-fetched JSON string as a data source.- The third argument
truesynchronizes the dictionary, generating fields to match the JSON structure.
How it works. The report binds to data you fetched yourself, so it works with any REST endpoint or in-memory JSON without the engine issuing its own request.