Skip to main content

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) method.

Register<T, TImpl>

IWebDocumentViewerAuthorizationService

Enables you to 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. Does not operate in asynchronous mode.

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 and synchronization mode for report file storage.
DefaultWebDocumentViewerContainer.UseFileDocumentStorage Specifies a path and synchronization mode for the report document’s file storage.
DefaultWebDocumentViewerContainer.UseFileExportedDocumentStorage Specifies a path and synchronization mode 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.

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>