Registering Data from Code
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.A dashboard's data can be supplied from code: load the dashboard, clear its connections, and register your own dataset with regData.
Preparing the data. Read or create the data source, register it in the dashboard dictionary, synchronize the schema, and render with the supplied records.
Preparing the data. Read or create the data source, register it in the dashboard dictionary, synchronize the schema, and render with the supplied records.
import { Viewer, Stimulsoft } from 'stimulsoft-dashboards-js-react/viewer';
function App() {
var report = new Stimulsoft.Report.StiReport();
report.loadFile('Dashboards/Orders.mrt');
report.dictionary.databases.clear();
var dataSet = new Stimulsoft.System.Data.DataSet();
dataSet.readJsonFile('Data/Orders.json');
report.regData('Orders', 'Orders', dataSet);
return <Viewer report={report} />;
}