The requested page is not available for the requested platform. You are viewing the content for Default platform.

WebDocumentViewerClientSideEventsBuilder.DocumentReady(String) Method

Sets the name of the JavaScript function or the entire code that will handle the DocumentReady client-side event of the Web Document Viewer.

Namespace: DevExpress.AspNetCore.Reporting.WebDocumentViewer

Assembly: DevExpress.AspNetCore.Reporting.v18.2.dll

Declaration

public WebDocumentViewerClientSideEventsBuilder DocumentReady(
    string callback
)
Public Function DocumentReady(
    callback As String
) As WebDocumentViewerClientSideEventsBuilder

Parameters

Name Type Description
callback String

The name of a JavaScript function or the entire JavaScript function code used to handle the DocumentReady event.

Returns

Type Description
WebDocumentViewerClientSideEventsBuilder

A WebDocumentViewerClientSideEventsBuilder that can be used to further configure the Document Viewer Client Side Events.

Remarks

The DocumentReady event enables you to respond to loading a report to the Document Viewer. When implementing a handling function, use the objects passed as parameters. The first parameter passes the event sender that is the ClientDocumentViewer object. The second one is an object with the following structure.

  • ReportId
    The report ID.

  • DocumentId
    The ID of the document that is ready to be shown in the Web Document Viewer.

  • PageCount
    The total number of pages in a report document.

The code sample below demonstrates how to use this event to navigate through pages of a ready document.

@{
    var documentViewer = Html.DevExpress().WebDocumentViewer("webDocumentViewer1")
        .Height("1000px")
        .Bind(Model.Report)
        .ClientSideEvents(configure => { configure.DocumentReady("documentReady"); });;
}
@documentViewer
See Also