[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
 [Expand]Product Information
 [Expand]Get Started with DevExpress Reporting
 [Expand]Create Popular Reports
 [Collapse]Detailed Guide to DevExpress Reporting
   Introduction to Banded Reports
  [Expand]Provide Data to Reports
  [Expand]Use Report Controls
  [Expand]Shape Report Data
   Arrange Dynamic Report Contents
  [Expand]Customize Appearance
  [Expand]Add Navigation
  [Expand]Provide Interactivity
  [Expand]Add Extra Information
  [Expand]Merge Reports
  [Expand]Use Expressions
  [Collapse]Store and Distribute Reports
    Reporting Security
   [Expand]Store Report Layouts and Documents
   [Expand]Globalize and Localize Reports
   [Collapse]Export Reports
     Document Export Overview
     Export Large Reports
     Email Reports
     Export to MailMessage
     Export to PDF
     Export to DOCX
     Export to RTF
     Export to Image
     Export to CSV
     Export to Text
     Export to XLS
     Export to XLSX
     Export to HTML
     Export to MHT
     Export to PPT
    Print Reports
  [Expand]Reporting API
 [Expand]Visual Studio Report Designer
 [Expand]Create End-User Reporting Applications
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Export to DOCX

This document describes specifics of exporting a document to the DOCX format (Microsoft Word 2007 Document).

The DocxExportOptions class provides options which define how to export the document to a DOCX file. You can access these options using the report's ExportOptions.Docx property.

The DocxExportOptions.ExportMode property specifies how a document is exported to DOCX.

  • In the DocxExportMode.SingleFilePageByPage mode, the export follows the WYSIWYG paradigm: the report's page headers and footers, and top and bottom margins appear on every page of the resulting document as they appear in the report's Print Preview. Elements residing in your report can be treated as frames (by default) or exported by tables (if you select a table layout).
  • In the DocxExportMode.SingleFile (continuous) mode, a multi-page report is converted into a single document with a table-like layout: the report's page headers and footers are repeated only once - at the beginning and end of the resulting document.

The following table lists DOCX-specific options and indicates which export modes support these options:


Single File


Single File




Specifies whether or not to include the existing text and image watermarks in a DOCX file.


Specifies the range of pages which should be exported to DOCX.


Determines whether to use the table or frame layout in the resulting DOCX file.


(if the TableLayout option is enabled)

Specifies whether the height of table rows in a resulting document should have fixed values.


Defines whether the header and footer contents should be displayed on the first page of the final document.


Specifies whether page breaks should be included in the resulting DOCX file.

Take into account the following specifics, when exporting documents in the DocxExportMode.SingleFile mode:

  • Composite report documents created from multiple merged documents cannot be exported to the DOCX format in the DocxExportMode.SingleFile (continuous) mode.

    As a workaround, use subreports (see XRSubreport) to combine multiple reports into a single document. Alternatively, export all your reports to DOCX files separately and then join all the exported data into a single file.

  • To locate controls' content in native header and footer sections of the resulting DOCX file, place these controls in the TopMarginBand or BottomMarginBand (not in the page footer and header).

Consider the following specifics, when exporting a document in the DocxExportMode.SingleFile mode and in the DocxExportMode.SingleFilePageByPage mode with the DocxExportOptions.TableLayout option enabled:

  • Only report controls that do not intersect with each other can be correctly exported to DOCX. Otherwise, the resulting file may have a broken layout.

    To preserve your report's layout in the DOCX format, enable the report's DesignerOptions.ShowExportWarnings property at design time, and ensure that there are no exclamation marks shown for intersecting controls (colored in red).

  • When exporting a document to DOCX in a table-like layout, the actual height of table rows in the resulting file can be adjusted by the Microsoft® Word® rendering mechanism automatically to fit the content. This can lead to increasing the page layout and produce the result that differs from the initial document in Print Preview. To avoid this and make the row height unaffected by adding new content, set the FormattedTextExportOptions.KeepRowHeight property to true.

    Leaving this property set to false (its default value) results in the height of table cells having non-fixed values. Adding a new line of text to a cell's content increases the row height.

    KeepRowHeight = false KeepRowHeight = true

In the DocxExportMode.SingleFilePageByPage export mode with the DocxExportOptions.TableLayout option enabled, controls whose content is split across several pages can be incorrectly exported. If your document contains such controls, use this mode with the frame layout (DocxExportOptions.TableLayout is set to false).

To specify whether or not vector images (e.g., pictures (see XRPictureBox), charts or bar codes) should be rasterized on export to DOCX, use the PageByPageExportOptionsBase.RasterizeImages property. When this option is enabled, you can also define the image resolution using the PageByPageExportOptionsBase.RasterizationResolution property.


You can export a report to DOCX in code using the following methods with or without the export options passed as a parameter:

Is this topic helpful?​​​​​​​