Skip to main content
A newer version of this page is available.
All docs
V17.2

ASPxClientWebDocumentViewer.DocumentReady Event

Occurs after the Web Document Viewer loads a report document.

Namespace: DevExpress.XtraReports.Web.Scripts

Assembly: DevExpress.XtraReports.v17.2.Web.Scripts.dll

Declaration

public event ASPxClientWebDocumentViewerDocumentReadyEventHandler DocumentReady

Event Data

The DocumentReady event's data class is ASPxClientWebDocumentViewerDocumentReadyEventArgs.

Remarks

Handle the DocumentReady event to respond to loading a report document to the Web Document Viewer on the client side.

The code snippet below demonstrates how to use this event to navigate through pages of a ready document. The ASPxClientWebDocumentViewerDocumentReadyEventArgs.PageCount field of an event argument specifies the total number of pages in the loaded document. To obtain the current page number and navigate to the next page, use the ASPxClientWebDocumentViewer.GetCurrentPageIndex and ASPxClientWebDocumentViewer.GoToPage methods.

<script type="text/javascript" id="script">
    function documentReady(s, e) {
        var goToNextPage = function () {
            var pageIndex = s.GetCurrentPageIndex();
            if (e.PageCount <= pageIndex)
                return;
            s.GoToPage(pageIndex + 1);
            setTimeout(function () { goToNextPage(); }, 3000);
        }
        goToNextPage();
    }
</script>

<dx:ASPxWebDocumentViewer ID="ASPxWebDocumentViewer1" runat="server" ReportSourceId="WebReportDesigner.XtraReport1">
     <ClientSideEvents DocumentReady="documentReady"/>
</dx:ASPxWebDocumentViewer>
See Also