Skip to main content
A newer version of this page is available. .

Register Services in the Document Viewer

  • 3 minutes to read

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>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

IExportingAuthorizationService

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

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

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>

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)

DocumentOperationService

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

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

IConnectionProviderFactory

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

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 provide time settings to clean a storage for storing documents and reports.

Register<T, TImpl>

RegisterSingleton<T, TImpl>

RegisterSingleton<T>(T)

CacheCleanerSettings

Enables you to provide time settings to clean a cache for storing 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 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>