Print a report directly at client-side without displaying it in a Viewer
Environment
Product | Progress® Telerik® Reporting |
Report Viewer | HTML5 Report Viewers |
Description
This article lists the required steps for printing a report directly on the client-side without displaying it in a report viewer.
Solution
The existing print functionality in web viewers is based on the following:
The report is exported in PDF format;
On rendering the PDF document, the reporting engine injects Adobe Javascript that forces the used PDF reader to open its Print dialog;
The PDF file is sent to the client in the browser in a hidden frame, where the browser must have properly configured and enabled PDF plugin to load the PDF file in the browser window;
Once the PDF is loaded in the browser, hidden from the user, the PDF plugin used as a PDF reader shows its Print dialog.
In the above scenario, the PDF plugin is a must for the browser. The approach is based on PDF export because applications running in a browser do not have permissions to access the machine (technology restrictions). For more details, please check Printing Reports.
To export the report in a PDF file, you can use a ReportProcessor in code instead of a viewer.
Notes
You can test the examples (ASP.NET WebForms and ASP.NET MVC) illustrating how to load a PDF file, generated by Telerik Reporting in code, in browser and rely on the browser's PDF plugin to print the document.
The result PDF file rendered on the server is returned with Content-Disposition header set to inline.
The confirmation of the print operation cannot be avoided due to security restrictions.