Skip to main content
All docs
V25.1
  • DxDocumentViewerCallbacksBase<TModel, TEvents> Class

    Base class that specifies client-side event handler functions for the Web Document Viewer and Standalone Report Parameters Panel.

    Namespace: DevExpress.Blazor.Reporting

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

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

    Declaration

    public class DxDocumentViewerCallbacksBase<TModel, TEvents> :
        SettingsComponent<TModel>
        where TModel : DocumentViewerCallbacksBaseModel<TEvents>, new()
       

    Type Parameters

    Name
    TModel
    TEvents

    Remarks

    The DxDocumentViewerCallbacks class contains properties that specify JavaScript handler functions for client-side events.

    View Example: Blazor Reporting - UI Customization API

    You can define a global JavaScript function in an external script file and add the file reference to the page. The following example handles the BeforeRender event to specify the Document Viewer’s zoom level:

    1. Create a JavaScript file in the project’s wwwroot/js folder. Write this code:

      window.ReportingViewerCustomization = {
          //Change default Zoom level
          onBeforeRender: function(s, e) {
              //-1: Page Width
              //0: Whole Page
              //1: 100%
              e.reportPreview.zoom = -1;
          }
      }
      
    2. Include the script file in the host page:

      <script src="~/js/reporting_ViewerCustomization.js"></script>
      
    3. Set the BeforeRender property to the function name:

      <DxDocumentViewer ReportName="SampleReport" Height="1000px" Width="100%">
          <DxDocumentViewerCallbacks BeforeRender="ReportingViewerCustomization.onBeforeRender" />
      </DxDocumentViewer>
      

    Inheritance

    Object
    ComponentBase
    DevExpress.Blazor.Reporting.Base.SettingsComponent<TModel>
    DxDocumentViewerCallbacksBase<TModel, TEvents>
    See Also