IWebDocumentViewerExportResultUriGenerator Interface

If implemented, enables you to override the default URI that a browser uses to get an export result.

Namespace: DevExpress.XtraReports.Web.WebDocumentViewer

Assembly: DevExpress.XtraReports.v19.2.Web.dll


public interface IWebDocumentViewerExportResultUriGenerator
Public Interface IWebDocumentViewerExportResultUriGenerator


You should use the IWebDocumentViewerExportResultUriGenerator service in web applications with header-token authentication to print and export documents.

For all API calls except print and export operations, the Web Document Viewer sends AJAX requests to the server. For print and export operations, a web browser requests the result from the server, but these requests have no headers.

On the server side, all requests are processed by a single endpoint:

When you use header-token authentication in your application, this single endpoint is protected (for instance, with a Bearer token). A web browser cannot obtain the export and print results, because its requests have no headers and cannot be authenticated.

To enable a browser to get export results, do the following:

  1. Configure another endpoint with a custom protection mechanism instead of header-token authentication.

  2. Implement the IWebDocumentViewerExportResultUriGenerator interface and return a custom URI in the CreateUri method. For instance, save an exported document to any storage and return the URI to access this document from the client side.

  3. Register the implemented service at the application's startup.

You can also use the IWebDocumentViewerExportResultUriGenerator service in any application to generate a more readable and user-friendly URI. Web browsers display info from this URI in the tab header. See the Web Document Viewer - How to change the name of a print job in printer queue GitHub example project for details.

See Also