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

In Angular.
import { Component } from "@angular/core";
import { Viewer, Stimulsoft } from "stimulsoft-dashboards-js-angular/viewer";

@Component({
    imports: [Viewer],
    template: `<sti-viewer [report]="report"></sti-viewer>`
})
export class Example {
    report: Stimulsoft.Report.StiReport;

    constructor() {
        this.report = new Stimulsoft.Report.StiReport();
        this.report.loadFile("Dashboards/Orders.mrt");
        this.report.dictionary.clear();

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

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.