[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]Getting Started with DevExpress Reporting
 [Expand]Creating Popular Reports
 [Collapse]Detailed Guide to DevExpress Reporting
   Introduction to Banded Reports
  [Expand]Providing Data to Reports
  [Expand]Using Report Controls
  [Expand]Shaping Report Data
   Laying out Dynamic Report Contents
  [Expand]Customizing Appearance
  [Expand]Adding Navigation
  [Collapse]Providing Interactivity
    Creating Drill-Down Reports
    Sorting a Report in Print Preview
    Content Editing in Print Preview
    Print Preview Mouse Events
    Creating Drill-Through Reports
    Obtaining a Label's Text in Print Preview
  [Expand]Adding Customary Information
  [Expand]Merging Reports
  [Expand]Using Expressions
  [Expand]Storing and Distributing Reports
  [Expand]Reporting API
 [Expand]Visual Studio Report Designer
 [Expand]Creating End-User Reporting Applications
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
This documentation page describes implementations made in our v17.2 release cycle. To learn about functionality shipping with v18.1, navigate to our updated help file experience at docs.devexpress.com. Learn More

Content Editing in Print Preview

This document provides information about interactive document editing in Print Preview that enables you to customize field values directly in a previewed document before printing or exporting it.

In this document, you will learn how to provide standard or custom editors to report controls, validate the user input and format the edited values.

This document consists of the following sections.

Expanded Content Editing Overview

When content editing is enabled for a report control (either unbound or data-aware), it is possible to customize the corresponding field values in Print Preview.

To enable content editing for a report control, expand its EditOptions property and set the EditOptions.Enabled property to true.

When the EditOptions.Enabled property is set to true and the EditOptions.ReadOnly property is disabled, the control's content can be edited in Print Preview (clicking a field will invoke the appropriate editor).

The following standard editors can be assigned to a control, depending on the kind of content it displays.

Memo Edit Check Box

To highlight all editing fields available in a document, click the Editing Fields button on the Print Preview toolbar. This button is disabled when there are no such fields in a document.

To navigate between editing fields in Print Preview, use the TAB and SHIFT+TAB keys.

Content Editing Specifics

When enabling content editing in your report, consider the following.

  • The changes made to a control's content in Print Preview have no effect on other parts of the document (e.g., the related summary results, grouping, sorting, bookmarks and other settings that have already been processed before generating the document).

  • The XRControl.CanGrow setting is ignored for editing fields.

    Multi-line values can only be entered when no mask is applied to an editing field. The editing area of a field cannot exceed the original dimensions of a control.

  • Values entered into editing fields are reset back to their defaults after refreshing the document (e.g., when submitting report parameter values and expanding or collapsing data in a drill-down report).

  • It is impossible to edit content of a control that has its DetailBand.DrillDownControl property specified.

  • Field values entered in Print Preview for controls placed onto the Top Margin and Bottom Margin bands are not preserved when the report is exported to TXT or CSV, as well as the following formats as a single file.

    • HTML
    • MHT
    • RTF
    • XLS
    • XLSX
    • image

The created report is platform-agnostic and its interactive features are supported by the Print Preview available for all application platforms.

To learn about the specifics of editing different kinds of content, see the following sections in this document.


Enable the PdfExportOptions.ExportEditingFieldsToAcroForms option to automatically convert a report's editing fields to AcroForms on PDF export.

Expanded Text Editing

The Label, Table Cell and Character Comb controls can be assigned editors to customize their content in Print Preview.

To enable content editing for these controls, expand their XRLabel.EditOptions property and set the EditOptions.Enabled property to true.

The following editors can be used to customize a field's content in Print Preview.

  • Default Editor

    By default, the TextEditOptions.EditorName property is not specified, and a memo edit is used as a standard editor.

  • Specific Value Editors

    You can assign a specific editor to a control using its TextEditOptions.EditorName property.

    The standard editors are divided into the following categories.

    Numeric Date-Time Letters
    • Integer
    • Integer Positive
    • Fixed-Point
    • Fixed-Point Positive
    • Date
    • Only Letters
    • Only Uppercase Letters
    • Only Lowercase Letters
    • Only Latin Letters

    Each value editor corresponds to a specific mask that ensures that only appropriate values can be entered and then formats the edited value.

    To learn how to implement custom validation of user input, see the Format Editing Field Values section in this document.

  • Custom Editors

    You can implement custom editors and add them to an existing or custom category. This is described in the Register a Custom In-Place Editor section of this document.


If a table cell contains other controls, its editing is disabled (but not the editing of the controls contained in this cell), which is illustrated in the following image.

Expanded Check Box Editing

The Check Box control's value can be edited in Print Preview.

To enable content editing for a check box, expand its XRCheckBox.EditOptions property and set the EditOptions.Enabled property to true.

In Print Preview, the control's behavior depends on the CheckEditOptions.GroupID setting.

  • When this property is set to null or an empty string value, a check box can be switched either to the "checked" or "unchecked" state (the "intermediate" state is not supported) independently on other available check boxes.

  • Otherwise, the field editor behaves like a radio button, and editors with the same GroupID value belong to a single logical group (i.e., only one option can be selected within a group at a time).

Expanded Runtime Specifics

The following example illustrates how to specify the editing options in code. To apply these settings to a document, the EnableDocumentEditing method must be invoked before calling the XtraReport.CreateDocument method.

Setting the EditOptions.Enabled property of a control to true results in one or more editing fields being added to the PrintingSystemBase.EditingFields collection. When accessing this collection to manage the editing fields, consider the following.

When the EditOptions.ReadOnly property is enabled (corresponds to the EditingField.ReadOnly property of a field), a corresponding field cannot be edited in Print Preview and is not highlighted as an editing fields. The following code illustrates how to disable content editing for a specific user in the PrintingSystemBase.AfterBuildPages event handler.

Expanded Format Edited Values

A format for a TextEditingField's value is specified differently depending on whether a control's content is static or is supplied from a data source.

  • If a control is unbound (i.e., its content is obtained from the XRControl.Text property value), the actual field value is obtained from the TextBrickBase.Text property of a corresponding brick.

    In this case, you can assign a required format directly to the Text property of the brick.

  • If a control is bound to data (i.e., its XRControl.DataBindings property is not null), the actual field value is obtained from the TextBrick.TextValue property of a corresponding brick.

    In this case, assign a required format to the TextBrick.TextValueFormatString property and update the TextBrickBase.Text property based on the field's TextValue.

The following code illustrates how to apply the same currency format to both unbound and data-aware controls in the PrintingSystemBase.EditingFieldChanged event handler. To check whether or not a field corresponds to a data-aware control, use the VisualBrick.TextValue property (it is null when a control's content is static).

Expanded Register a Custom Field Editor

To learn how to use custom controls (e.g., a combo box editor) for report editing in Print Preview, view the following examples online.

Expanded See Also

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