This example prints and exports a report in a browser without previewing it on a web page.
On the server side, add a controller action to:
- create a report;
- export the report to PDF: you can do so asynchronously using the XtraReport.ExportToPdfAsync method;
- send back to the client.
On the client-side, two options are available:
-
Print a report in a new tab. Create a print button and invoke a new tab by using the client-side
window.Open(url, "_blank")
method to open a new tab and allow clients to print a document. -
Print a report with iFrame. Once a client clicks the print button, invoke the browser's Print dialog in the
HTMLIFrameElement
so that users can proceed with printing the document.
Create a server-side controller action to export a report to a format selected by a user.