Back to Devexpress

Document Viewer Server-Side Application from Microsoft Template (ASP.NET MVC)

xtrareports-403774-web-reporting-asp-net-mvc-reporting-server-side-configuration-document-viewer-server-side-application-from-microsoft-template-asp-net-mvc.md

latest2.4 KB
Original Source

Document Viewer Server-Side Application from Microsoft Template (ASP.NET MVC)

  • Aug 21, 2025
  • 2 minutes to read

This document describes how to create and configure the backend application required to integrate Document Viewer in client-side JS frameworks.

  1. Create a new ASP.NET MVC project from the Microsoft Visual Studio template:

  2. Install the following NuGet packages from the DevExpress NuGet Gallery:

  3. Right-click the Controllers folder in the Solution Explorer and select Add | Controller…. Create the WebDocumentViewerController controller inherited from the WebDocumentViewerApiControllerBase class. Set up cross-origin resource sharing (CORS) on your back-end to configure permissions to access resources from a server with a different origin. Implement the Invoke action to allow CORS requests from all origins as shown below.

  4. Create the Services folder in the project. Right-click the folder in the Solution Explorer and select Add | Class to create the CustomReportProvider class that implements the IReportProvider interface. The CustomReportProvider service uses the report string ID to return the report instance:

  5. Register the CustomReportProvider service at application startup:

  6. If a report is bound to a database, add the related connection string to the Web.config file. For more information on connection strings, review the following help topic: Connection Strings for XPO Providers.

  7. Check the project’s Properties | Web section to determine the protocol prefix (HTTP or HTTPS) and the server port number. Use these settings to specify the server-side application URL in the client application configuration.

  8. Run the project.

See Also

Redistribution and Deployment (ASP.NET MVC Reporting)