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);
}

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.