Skip to main content

DxDocumentViewerCallbacks.DocumentReady Property

Specifies the handler for the DocumentReady client-side event that occurs before the Document Viewer loads a document.

Namespace: DevExpress.Blazor.Reporting

Assembly: DevExpress.Blazor.Reporting.v24.1.JSBasedControls.Common.dll

NuGet Package: DevExpress.Blazor.Reporting.JSBasedControls.Common

Declaration

[Parameter]
public string DocumentReady { get; set; }

Property Value

Type Description
String

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

Remarks

The DocumentReady event occurs before the Document Viewer loads a document.

The handler function receives two parameters - the first parameter is the client-side Document Viewer (the event sender) and the second parameter is an object with the following properties and methods:

  • 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 document.

The following code causes the Document Viewer to flip through document pages:

window.ReportingViewerCustomization = {
    onDocumentReady: function (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();
    }
}
See Also