A report can be connected to a data source entirely from code, without editing the template dictionary.

Preparing the data. Read or create the data source, register it in the report dictionary, synchronize the schema, and render with the supplied records.
import { Viewer, Stimulsoft } from 'stimulsoft-reports-js-react/viewer';

function App() {
    var report = new Stimulsoft.Report.StiReport();
    report.loadFile('Reports/SimpleList.mrt');
    report.dictionary.clear();

    var database = new Stimulsoft.Report.Dictionary.StiJsonDatabase('Demo', 'Data/Demo.json');
    report.dictionary.databases.add(database);
    report.dictionary.synchronize();

    return <Viewer report={report} />;
}

export default App;

A StiJsonDatabase is created with a name and a path to the JSON file, added to dictionary.databases, and dictionary.synchronize() rebuilds the data schema so the report can bind to it.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.