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

ASPxClientWebDocumentViewer.DocumentReady Event

Occurs after the Web Document Viewer loads a report document.

Namespace: DevExpress.XtraReports.Web.Scripts

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

Declaration

public event ASPxClientWebDocumentViewerDocumentReadyEventHandler DocumentReady
Public Event DocumentReady As ASPxClientWebDocumentViewerDocumentReadyEventHandler

Event Data

The DocumentReady event handler receives an argument of the ASPxClientWebDocumentViewerDocumentReadyEventArgs type.

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