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

Client-side events. Every viewer event is exposed as an Angular output. Bind your handlers with the (event) syntax:
export class AppComponent {
    loaded(): void {
        console.log('Report loaded');
    }

    export(event: any): void {
        console.log(`Export to: ${event.exportFormat}`);
    }
}

<stimulsoft-viewer-angular
    [requestUrl]="'/Viewer/{action}'"
    [action]="'InitViewer'"
    [height]="'100vh'"
    (loaded)="loaded()"
    (export)="export($event)">
</stimulsoft-viewer-angular>

Two events are handled here: (loaded) fires once the report has been rendered and is ready, and (export) fires when the user exports the report — the event object carries details such as the exportFormat. The same pattern works for other viewer events; simply bind the corresponding output.

Server-side handling. Interactive events that need the server are routed to the ViewerEvent action registered during initialization:
[HttpPost]
public IActionResult ViewerEvent()
{
    return StiAngularViewer.ViewerEventResult(this);
}

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