Register Services in the Document Viewer

  • 3 minutes to read

You can register custom and/or predefined services to add specific functionality to the Web Document Viewer.

Custom Services

You can use the DefaultWebDocumentViewerContainer class methods to implement and register the following services in the Document Viewer:

Service

Description

Registration Methods

IReportProvider

Resolves report IDs for reports and subreports. Has priority over the [ReportStorageWebExtension.GetData(String)](xref:DevExpress.XtraReports.Web.Extensions.ReportStorageWebExtension.GetData method.

Register<T, TImpl>

IWebDocumentViewerAuthorizationService

Enables you to implement implement access permissions for reports and documents in the Web Document Viewer.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

IExportingAuthorizationService

Enables you to implement access permissions for exported documents in the Web Document Viewer.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

WebDocumentViewerOperationLogger

Allows you to log events that occur when the Web Document Viewer loads and processes a report. You can modify a report or a document, or perform any action when an event occurs.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

IWebDocumentViewerDrillThroughProcessor

Provides drill-through functionality to web reports.

RegisterWebDocumentViewerDrillThroughProcessor<T>

IWebDocumentViewerReportResolver

Resolves reports that can be displayed by the Web Document Viewer.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

ICachedReportSourceWebResolver

Returns a CachedReportSourceWeb object associated with the specified report.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

DocumentOperationService

Allows you to perform custom operations on the Document Viewer's currently opened document.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

IConnectionProviderFactory

Allows you to restore a data connection on report deserialization.

RegisterConnectionProviderFactory<T>

IWebDocumentViewerExceptionHandler

Enables you to handle server-side errors in the Web Document Viewer.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

IWebDocumentViewerExportResultUriGenerator

Allows you to override the default URI that a browser uses to get an export result.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

StorageCleanerSettings

Enables you to set the time to clean the document and report storage.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

CacheCleanerSettings

Allows you to set the time to clean the cache that stores documents and reports.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

Predefined Services

Use the following methods of the DefaultWebDocumentViewerContainer to register the corresponding predefined services that override the default Document Viewer behavior:

Method Description
DefaultWebDocumentViewerContainer.UseFileReportStorage Specifies a path for the report's file storage.
DefaultWebDocumentViewerContainer.UseFileDocumentStorage Specifies a path for the report document's file storage.
DefaultWebDocumentViewerContainer.UseFileExportedDocumentStorage Specifies a path for the exported document's file storage.
DefaultWebDocumentViewerContainer.UseEmptyStoragesCleaner Replaces the service used to clean the report and document storage with an empty service, so that the storage is not automatically cleaned.
DefaultWebDocumentViewerContainer.EnablePassingExportOptionsPasswordsToClient Passwords for PDF/Excel export (specified in the End User Report Designer or stored in the REPX file) are not passed to the Web Document Viewer unless this method is called at application startup.

Logger Service

Use the LoggerService class to handle exceptions that occur on the server side and log other specific operations (document export, requests to open reports from the client side, etc.). To register a custom logger instance, use the LoggerService.Initialize method at application startup.

Common Services for HTML5 Controls

You can use the DefaultClientControlContainer class to register the following custom services common to HTML5 controls:

Service Description Registration Method
IGlobalizationService Enables you to customize globalization settings of the current thread (including thread impersonation). UseCustomGlobalizationService<T>