Using SQL Data Sources
Our sample projects and report templates can help you learn the basics of working with our products.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=;';
};
}
}