Set up the report viewer in Angular, load a template, and connect the component to the application.

Viewer setup. Configure the viewer, load the report, assign it to the component, and process the requests or events raised by the UI.
@Component({
    selector: "using-viewer-events",
    imports: [Viewer],
    template: `<sti-viewer [report]="report" [options]="viewerOptions" (onEmailReport)="onEmailReport($event)"></sti-viewer>`
})
export class UsingViewerEvents {
    report = new Stimulsoft.Report.StiReport();
    viewerOptions = new Stimulsoft.Viewer.StiViewerOptions();
    onEmailReport(args: Stimulsoft.Viewer.EmailReportArgs) {
        alert(`Email: ${args.settings.email} File name: ${args.fileName}`);
    }
    constructor() {
        this.report.loadFile("Reports/SimpleList.mrt");
        this.viewerOptions.toolbar.showSendEmailButton = true;
    }
}
Events are bound with Angular's (event) syntax or Vue's @event directive; here the handler receives the e-mail settings and file name. The same pattern covers print, export and design events.

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