Printing the Dashboard from Code
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.A dashboard can be sent to the printer straight from code — as PDF or as HTML.
In Angular.
How it works. The report object handles rendering and hands the result to the browser's print flow, so no viewer is required.
In Angular.
@Component({
template: `
<button (click)="printPdf_Click()">Print PDF</button>
<button (click)="printHtml_Click()">Print HTML</button>`
})
export class Example {
report: Stimulsoft.Report.StiReport;
printPdf_Click() { this.report.printToPdf(); }
printHtml_Click() { this.report.print(); }
constructor() {
this.report = new Stimulsoft.Report.StiReport();
this.report.loadFile("Dashboards/Dashboard.mrt");
}
}report.printToPdf()— render and print the dashboard through the PDF print path.report.print()— print via the HTML path; both open the browser print dialog.
How it works. The report object handles rendering and hands the result to the browser's print flow, so no viewer is required.