[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Collapse]Reporting
 [Expand]Product Information
 [Expand]Getting Started with DevExpress Reporting
 [Expand]Creating Popular Reports
 [Expand]Detailed Guide to DevExpress Reporting
 [Expand]Visual Studio Report Designer
 [Collapse]Creating End-User Reporting Applications
   Cross-Platform Reporting
  [Expand]WinForms Reporting
  [Expand]WPF Reporting
  [Collapse]Web Reporting
   [Collapse]Web Reporting Overview
    [Expand]General Information
    [Collapse]Printing and Exporting
      Printing Overview
      Printing and Exporting in Code
      Printing a Remotely Created Document in an ASP.NET
      Printing a Remotely Created Document in an ASP.NET MVC
      Implementing an Asynchronous Export of Documents
     ASP.NET Core Reporting (.NET Framework)
     Microsoft Azure Reporting
   [Expand]Document Viewer
   [Expand]Report Designer
   [Expand]Using Reporting Controls in JS
   [Expand]Application Security
    Application Appearance
   [Expand]Application Deployment
    Localization
    End-User Documentation
  [Expand]WCF Report Service
  [Expand]Discontinued Platforms
   Localization
   Redistribution and Deployment
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
This documentation page describes implementations made in our v17.2 release cycle. To learn about functionality shipping with v18.1, navigate to our updated help file experience at docs.devexpress.com. Learn More

Printing a Remotely Created Document in an ASP.NET MVC

This tutorial provides an example on how to use a ASP.NET Document Viewer in ASP.NET MVC to publish a document supplied by a remote document source.

Note

This scenario is not currently supported by the HTML5 Document Viewer.

The tutorial consists of the following sections.

Expanded Prepare the Server Part

This section of the tutorial describes how to provide an ASP.NET MVC application with a server part (the 'back end'), which hosts a report service used as a remote document source.

  1. To add a server part to the solution, switch to the Solution Explorer (by pressing CTRL+ALT+L) and right-click the solution. In the invoked context menu, select Add | New Project….

    In the invoked Add New Project dialog, expand the Web category, select ASP.NET Empty Web Application and click OK.

  2. To add a report service to the application's server side, right-click WebApplication1 in the Solution Explorer. In the invoked context menu, select Add | New Item….

    In the invoked Add New Item dialog, expand the Reporting category, select DevExpress v18.1 Report Service and click Add.

    Using the same dialog, add a Report Class to the server part. Provide a layout for the newly added report. See the Creating Popular Reports section to learn about the different aspects of designing a report.

Expanded Prepare the Client Part

To display a document obtained from a report service, use the DocumentViewerSettings.SetRemoteSourceSettings method to access and specify the ServiceUri and ReportTypeName properties of the object returned by the DocumentViewerSettings.SettingsRemoteSource property.

To implement this functionality, the following code is added to the DocumentViewerPartial.cshtml partial view.

The following code is added to the ExportDocumentViewer action in the HomeController.cs file.

Expanded Publish the Document

Run the application to view the resulting ASP.NET MVC page, which displays the created document in the system's default Web browser.

To print or export the document, use the corresponding commands in the ASP.NET Document Viewer Toolbar.

Is this topic helpful?​​​​​​​