DocumentOperationService Class
Allows you to perform a custom operation initiated on the client.
Namespace: DevExpress.XtraReports.Web.WebDocumentViewer
Assembly: DevExpress.XtraReports.v24.2.Web.dll
NuGet Package: DevExpress.Web.Reporting.Common
Declaration
Remarks
You can call the following method on the client side to initiate a custom operation:
ASP.NET Web Forms & MVC | ASP.NET Core & JS Frameworks |
---|---|
ASPxClientWebDocumentViewer.PerformCustomDocumentOperation | JSReportViewer.PerformCustomDocumentOperation |
On the server, you should create a DocumentOperationService class descendant, and override its DocumentOperationService.CanPerformOperation method to define which operations are permitted and the DocumentOperationService.PerformOperation method to perform the operation.
You should register the DocumentOperationService class descendant (the CustomDocumentOperationService
class in the following code snippets) at application startup:
- ASP.NET Core
using DevExpress.XtraReports.Web.WebDocumentViewer; var builder = WebApplication.CreateBuilder(args); builder.Services.AddDevExpressControls(); builder.Services.AddScoped<DocumentOperationService, CustomDocumentOperationService>(); var app = builder.Build();
- ASP.NET MVC
using DevExpress.XtraReports.Web.WebDocumentViewer; // ... public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { // ... DefaultWebDocumentViewerContainer.Register<DocumentOperationService, Services.CustomDocumentOperationService>(); // ... MVCxWebDocumentViewer.StaticInitialize(); // ... } // ... }
- ASP.NET Web Forms
using DevExpress.XtraReports.Web.WebDocumentViewer; // ... void Application_Start(object sender, EventArgs e) { ..//. DefaultWebDocumentViewerContainer.Register<DocumentOperationService, CustomDocumentOperationService>(); //... ASPxWebDocumentViewer.StaticInitialize(); }
For a code sample, review the following example: