This example demonstrates how to print or export a report in an ASP.NET MVC application without displaying this report's preview.
Follow the steps below to print or export a report:
- Call one of the report's ExportTo... methods to obtain an exported document.
- Call the Controller.File method to convert the exported document into a FileContentResult object.
Follow the steps below to print a report:
- Export the report to PDF.
- Return the exported PDF file as an action result with the Content-Disposition header set to inline.
- The returned PDF is opened by the browser's built-in PDF viewer. To avoid this, export the PDF to a separate iframe - only the print dialog is displayed.