New to Telerik Reporting? Download free 30-day trial

Events Overview

How to use the Events

  1. Create a handler function in the component's .TS file:

    export class ReportViewerComponent implements AfterViewInit {
        @ViewChild('viewer1') viewer: TelerikReportViewerComponent;
        ...
        ready() {
            console.log('ready');
        }
        viewerToolTipOpening(e: any, args: any) {
            console.log('viewerToolTipOpening ' + args.toolTip.text);
        }
    }
    
  2. In the .HTML component file, assing the handler to the corresponding event:

    <tr-viewer #viewer1 [containerStyle]="viewerContainerStyle" [serviceUrl]="'http://localhost:59655/api/reports/'"
        [reportSource]="{
            report: 'Report1.trdp',
            parameters: {}
        }"
        [ready]="ready"
        [viewerToolTipOpening]="viewerToolTipOpening"
        [enableAccessibility]="false">
    </tr-viewer>
    

Below is a list of all available report viewer events.

Events

Parameter Description
ready function(); optional; A callback function that will be called when the viewer content has been loaded from the template and is ready to display reports or perform any other operations on it. The function is executed in the context of the ReportViewer object that is available through the this object.
exportBegin function(e, args);optional; A callback function that will be called prior to starting the report export command.
exportEnd function(e, args);optional; A callback function that will be called when the exported document is ready for download, but prior to the actual downloading.
printBegin function(e, args);optional; A callback function that will be called prior to starting the print report command.
printEnd function(e, args);optional; A callback function that will be called when the print document (Adobe PDF) is ready for download, but prior to being send to the printer.
renderingBegin function(e, args);optional; A callback function that will be called when the rendering of the report begins.
renderingEnd function(e, args);optional; A callback function that will be called when the rendering of the report ends.
sendEmailBegin function(e, args);optional; A callback function that will be called before the report is exported and the E-mail message is sent.
sendEmailEnd function(e, args);optional; A callback function that will be called after the report is exported and before the E-mail message is sent.
updateUi function(e);optional; A callback function that will be called every time the UI needs an update; can be used for changing the UI of the report viewer while interacting with the reports.
pageReady function(e, args);optional; A callback function that will be called every time a page from the report is rendered and ready for display.
error function(e, args);optional; A callback function that will be called when an error occurs.
interactiveActionExecuting function(e, args);optional; A callback function that will be called before an interactive action is executed, providing the ability to cancel the execution.
interactiveActionEnter function(e, args);optional; A callback function that will be called when the mouse cursor enters the area of an interactive action.
interactiveActionLeave function(e, args);optional; A callback function that will be called when the mouse cursor leaves the area of an interactive action.
viewerToolTipOpening function(e, args);optional; A callback function that will be called when a tooltip is being opened.

For more details on each event and its arguments/return value, please refer to the HTML5 Report Viewer Events.

In this article