A data connection can be built from code and added to the dashboard's dictionary, replacing whatever the template carried.

In React.
import { Viewer, Stimulsoft } from "stimulsoft-dashboards-js-react/viewer";

function App() {
    var report = new Stimulsoft.Report.StiReport();
    report.loadFile("Dashboards/Orders.mrt");
    report.dictionary.clear();

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

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

How it works. The dashboard resolves its elements against the code-built connection, so its data source is defined entirely in code.

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