Render the report in Angular and start the print workflow with settings supplied by the application.

Printing from code. Load and render the report, apply the printer settings, and start the print workflow from application code.
@Component({
    selector: "printing-the-report-from-code",
    template: `
        <div class="container">
            <h4>This sample demonstrates how to print a report:</h4>
            <div class="container-button">
                <button (click)="printPdf_Click()" class="button" title="Print Report as PDF File">Print PDF</button>
                <button (click)="printHtml_Click()" class="button" title="Print Report as HTML File">Print HTML</button>
            </div>
        </div>`
        ,
    styleUrls: ['../styles.css']
})

export class PrintingTheReportFromCode {
    report: Stimulsoft.Report.StiReport;

    printPdf_Click() {
        this.report.printToPdf();
    }

    printHtml_Click() {
        this.report.print();
    }

    constructor() {
        this.report = new Stimulsoft.Report.StiReport();
        this.report.loadFile("Reports/SimpleList.mrt");
    }
}

report.printToPdf() prints through a generated PDF for pixel-accurate output, while report.print() uses the HTML print path — both open the browser print dialog for a loaded report.

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