Register Services in the Document Viewer

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

Custom Services

The following table lists the available services you can implement and register in the Document Viewer using the methods of the DefaultWebDocumentViewerContainer class:

Service

Description

Registration Methods

IWebDocumentViewerAuthorizationService

Enables you to implement a custom authorization mechanism in your web reporting application.

Register<T, TImpl>

IExportingAuthorizationService

Enables you to provide a custom authorization mechanism for exported documents in your web reporting application.

Register<T, TImpl>

WebDocumentViewerOperationLogger

Allows you to log events related to processing reports and generated documents by the Web Document Viewer engine.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

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>

UseReportStorageExtensionReportResolver (to register a service implementation based on an existing report storage).

DocumentOperationService

Enables you to perform custom operations with a Document Viewer's currently opened document.

Register<T, TImpl>

IConnectionProviderFactory

Allows you to restore a data connection on deserializing a report.

RegisterConnectionProviderFactory<T>

StorageCleanerSettings

Enables you to provide time settings to clean a storage for storing documents and reports.

Register<T, TImpl>

CacheCleanerSettings

Enables you to provide time settings to clean a cache for storing documents and reports.

Register<T, TImpl>

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 a service that is used to clean the report and document storage with an empty service, avoiding automatic cleaning of this storage.
DefaultWebDocumentViewerContainer.EnablePassingExportOptionsPasswordsToClient Enables passing PDF/Excel passwords specified in the Report Designer to the Web Document Viewer.

Logger Service

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

Common Services for HTML5 Controls

You can create custom services common for HTML5 controls and register them using the DefaultClientControlContainer class.

Service Description Registration Method
IGlobalizationService

Enables you to customize globalization settings of the current thread (including thread impersonation).

UseCustomGlobalizationService<T>