Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Collapse]Printing-Exporting
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamental Concepts
   [Collapse]Concepts
    [Expand]Basic Terms
    [Expand]Print Preview
    [Collapse]Exporting
      Export to PDF
      Export to HTML
      Export to MHT
      Export to Text
      Export to CSV
      Export to XLS
      Export to XLSX
      Export to RTF
      Export to Image
      Export to MailMessage
    [Expand]Miscellaneous
   [Expand]Examples
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Export to RTF

This document describes specifics of exporting a document to the RTF format (Rich Text Format).

Tip

A code example illustrating how to export a report to RTF is available at How to export a report to RTF format.

The RtfExportOptions class provides options which define how to export the document to an RTF file. You can access these options using the report's ExportOptions.Rtf property.

The RtfExportOptions.ExportMode property specifies how a document is exported to RTF.

  • In the RtfExportMode.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 are treated as frames in the resulting file.

  • In the RtfExportMode.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.

Note

Not all programs that can be used to view and edit RTF files can correctly process the resulting RTF file. For instance, Microsoft® Word® displays these files correctly, while WordPad® does not. Note that this is not due to any problem in our product - WordPad does not fully support the RTF standard.

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

Option

Single File
(Continuous)

Single File
Page-by-Page

Description

FormattedTextExportOptions.ExportWatermarks

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

FormattedTextExportOptions.PageRange

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

FormattedTextExportOptions.KeepRowHeight

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

FormattedTextExportOptions.EmptyFirstPageHeaderFooter

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

FormattedTextExportOptions.ExportPageBreaks

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

Take into account the following specifics, when exporting a document in the RtfExportMode.SingleFile mode:

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

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

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

    To preserve your report's layout in the RTF 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 RTF 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 a 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

Vector images (e.g., pictures, charts or bar codes) are always rasterized on export to RTF. You can use the PageByPageExportOptionsBase.RasterizationResolution property to define the image resolution.

How would you rate this topic?​​​​​​​