Skip to main content
All docs
V18.2

ASPxClientReportDesigner.PreviewDocumentReady Event

Occurs after a report has been switched to Print Preview.

Namespace: DevExpress.XtraReports.Web.Scripts

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

Declaration

public event ASPxClientWebDocumentViewerDocumentReadyEventHandler PreviewDocumentReady

Event Data

The PreviewDocumentReady event's data class is ASPxClientWebDocumentViewerDocumentReadyEventArgs.

Remarks

Handle the PreviewDocumentReady event to respond to loading a report to the Document Viewer built into the Web Report Designer.

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.

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

<dx:ASPxReportDesigner ID="ASPxReportDesigner1" runat="server">      
    <ClientSideEvents PreviewDocumentReady="previewDocumentReady"/>  
</dx:ASPxReportDesigner>
See Also