Skip to main content
A newer version of this page is available. .

Print and Export

  • 3 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 to EMF and WMF formats is not supported in Linux environment. You can handle the client-side CustomizeExportOptions event to remove the Format combobox in the Image Export Options section of the Export Options tab:

function onCustomizeExportOptions(s, e) {
          e.HideProperties(DevExpress.Reporting.Viewer.ExportFormatID.Image, "Format");            
}

The default Image export format is PNG. If you wish to set it to a different value, change the ImageExportOptions.Format property in the report’s ExportOptions.Image settings.

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 to true.

Export action opens a new page with a progress indicator:

See Also