Using SQL Data Sources
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.Dashboards can pull data from SQL databases through a data-adapter service; the connection is supplied in the onBeginProcessData event.
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 { Component } from '@angular/core';
import { Viewer, Stimulsoft } from 'stimulsoft-dashboards-js-angular/viewer';
@Component({
selector: 'app-root',
imports: [Viewer],
template: `<sti-viewer [report]="report"></sti-viewer>`
})
export class AppComponent {
report: Stimulsoft.Report.StiReport;
constructor() {
Stimulsoft.StiOptions.WebServer.url = 'http://localhost:9615/';
this.report = new Stimulsoft.Report.StiReport();
report.loadFile('Dashboards/SalesOfProducts.mrt');
report.onBeginProcessData = function (args) {
args.connectionString = 'Server=localhost; Database=northwind; UserId=root; Pwd=;';
};
}
}