All docs
V20.1
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Print and Export

  • 2 minutes to read

Web applications use the Web Document Viewer to publish report documents. The server-side ASPxWebDocumentViewer control generates a document and sends it to the client. The client-side ASPxClientWebDocumentViewer object allows you to preview, navigate, export and/or print the document.

TIP

You can print or export a report in a web application without a preview. For more information, review the following help topic: Print and Export without a Preview.

Client Side Print

The Document Viewer renders the report in PDF and invokes the PDF plug-in's Print dialog.

Document Viewer UI

Click Print to print the entire document or click Print Page to print the currently active document page.

HTML5DC_PrintButton

HTML5DC_PrintPageButton

Use the ASPxClientWebDocumentViewer.Print method to print a report on the client side. The method returns PDF data and the Document Viewer passes them to the browser.

Use PDF Plug-in

If the browser contains the PDF plug-in, the Print dialog is invoked. To print the document, specify print settings and click Print:

If the PDF plug-in is unavailable, the Document Viewer exports the report document to a PDF file, and initiates the download instead of printing. The resulting PDF file contains a script that starts printing when the PDF viewer opens the file.

Client Side Export

Document Viewer UI

To export a document to the selected format, click Export To and select the export format from the list.

The exported document file is downloaded automatically.

You can click Export Options to invoke the Export Options panel and specify options for different formats:

You can customize the Document Viewer panel as follows:

  • hide the Export Options panel
  • exclude export formats from the drop-down list
  • hide options for the specified export format
  • change the default export options displayed in the Export Options panel.

To do this, handle the CustomizeExportOptions event (ASP.NET) or specify the CustomizeExportOptions callback function (JavaScript frameworks). The function argument is an ASPxClientCustomizeExportOptionsEventArgs object. You can use its properties and methods to specify export options and customize the export panel.

Export in Code

Use the ASPxClientWebDocumentViewer.ExportTo method to export a document. Handle the CustomizeExportOptions client-side event to specify export options.

The Web Document Viewer can export reports asynchronously (export operations are run in the background). To switch to the asynchronous export mode, set the AsyncExportApproach static variable to true.

Export action opens a new page with a progress indicator:

See Also