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

Document Export Overview

  • 3 minutes to read

You can export a report document to multiple formats.

Export a Report

You can export a report from the Report Designer’s Preview and from the Document Viewer on all supported platforms (WinForms, WPF, ASP.NET WebForms, ASP.NET MVC, and ASP.NET Core). Expand the Export Document drop-down list and select the format to export to. Specify export options in the invoked dialog, and click OK.

export-report-design-time

At runtime, the XtraReport class provides methods to export a report document to all supported export formats. Call a report’s export method and pass an ExportOptionsBase descendant class instance as a parameter in order to specify the export options:

Export Format Export Method Export Options
PDF ExportToPdf(String, PdfExportOptions) PdfExportOptions
DOCX ExportToDocx(String, DocxExportOptions) DocxExportOptions
RTF ExportToRtf(String, RtfExportOptions) RtfExportOptions
Image ExportToImage(String, ImageExportOptions) ImageExportOptions
CSV ExportToCsv(String, CsvExportOptions) CsvExportOptions
TXT ExportToText(String, TextExportOptions) TextExportOptions
XLS ExportToXls(String, XlsExportOptions) XlsExportOptions
XSLX ExportToXlsx(String, XlsxExportOptions) XlsxExportOptions
HTML ExportToHtml(String, HtmlExportOptions) HtmlExportOptions
MHT ExportToMht(String, MhtExportOptions) MhtExportOptions
MailMessage ExportToMail(MailMessageExportOptions) MailMessageExportOptions

Note

Once the document export has started, it runs until the export document is complete and cannot be interrupted or canceled.

Export Modes

Set the ExportOptions.ExportMode property to one of the values below to specify the report document’s export mode:

  • Single File
    The report is expoted into one file that contains one page. The report’s page headers, footers, top and bottom margins appear only once, at the beginning and end of the resulting page.
  • Single File Page-by-Page
    The report is exported into one file that contains multiple pages. Each page corresponds to a report document page. The report’s page headers, footers, top and bottom margins appear on every page, exactly as they appear in the report’s Preview.
  • Different Files
    The report is exported into multiple files. Each file contains one page that corresponds to a report document page. The report’s page headers, footers, top and bottom margins appear on every page, exactly as they appear in the report’s Preview.

These modes are available in the following export formats:

Format

Single File

Single File Page-by-Page

Different Files

PDF

Icon-no

Icon-yes

Icon-no

DOCX

Icon-yes

Icon-yes

Icon-no

RTF

Icon-yes

Icon-yes

Icon-no

Image

Icon-yes

Icon-yes

Icon-yes

Text:

Icon-yes

Icon-no

Icon-no

Excel:

Icon-yes

Icon-yes

Icon-yes

Web Documents:

Icon-yes

Icon-yes

Icon-yes

Use the PrintControl.DisableExportModeValues method to limit the list of export modes available for each export format in your application.

Note

You cannot export reports merged page by page in the Single File export mode.

As a workaround:

  • Use subreports to merge multiple reports into a single document.
  • Export all your reports to separate files and then join these files in a single file.

Export Reports with Overlapped Controls

Overlapped controls are highlighted in reports. Users can position their mouse pointer over such controls to see what needs to be fixed.

ShowExportWarnings

Tip

Disable a report’s DesignerOptions.ShowExportWarnings property to remove highlights on overlapped controls.

You can export reports with overlapped controls into the following formats:

An attempt to export reports with overlapped controls into other formats causes an error.