[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
[Collapse]Reporting
 [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
  [Collapse]Shaping Report Data
   [Expand]Data Filtering
   [Expand]Grouping and Sorting
   [Expand]Shaping Data using Expression Bindings
   [Collapse]Shaping Data using Legacy Data Bindings
     Formatting Data
     Conditionally Changing a Control's Appearance
     Conditionally Changing a Label's Text
     Conditionally Filtering Report Data
     Conditionally Suppressing Controls
     Limiting the Number of Records per Page
     Limiting the Number of Records per Group
     Conditionally Changing a Band's Visibility
     Calculating a Summary
     Calculating a Running Summary
     Calculating a Custom Summary
     Simulating the Mail Merge Feature for Summary Fields
     Displaying Row Numbers in a Report, Group or Page
     Counting the Number of Records in a Report or Group
     Counting the Number of Groups in a Report
   [Expand]Using Calculated Fields
   [Expand]Using Report Parameters
   Laying out Dynamic Report Contents
  [Expand]Customizing Appearance
  [Expand]Adding Navigation
  [Expand]Providing Interactivity
  [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]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[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

Formatting Data

This document describes how to format data in a report by applying a .NET format to it.

Note

This approach to formatting data applies when the UserDesignerOptions.DataBindingMode is set to DataBindingMode.Bindings.

When using this mode, you can only apply formatting to values bound to a control's properties, and not to the controls' static content.

See Formatting Data to learn how to format a report's data when this property is set to DataBindingMode.Expressions or DataBindingMode.ExpressionsAdvanced.

See Data Binding Modes to learn more about the available binding modes.

This tutorial consists of the following sections:

Expanded Format Data-Bound Controls

  1. Select a data-bound report control to which to apply a format string and click its smart tag. Click the XRBinding.FormatString property's ellipsis button, and in the invoked FormatString Editor, choose the required formatting by selecting one of the built-in patterns or entering a custom format string.

  2. When using mail-merge to make a label display both static and dynamic data, you can add a format to the label's dynamic contents by separating it from the data field name with the ! symbol.

Note

The XRBinding.FormatString setting is ignored for Null, DBNull and String.Empty values.

Use the XRControl.NullValueText and XRControl.ProcessNullValues properties to process such values.

Expanded Format Summaries

The XRSummary object has an XRSummary.FormatString property. The summary format is defined independently and has priority over the general value format.

Select a label with an assigned summary function, click its smart tag and specify the Format String property.

Expanded Apply the Native XLSX Format

In addition to a .NET format string, you can also apply a native XLSX format to an XRLabel's or XRTableCell's content using its XRControl.XlsxFormatString property. A value assigned to this property is converted to a native Excel format string when exporting the report to XLSX if the XlExportOptionsBase.TextExportMode property is set to Value.

When the XRControl.XlsxFormatString property is not set to any value, the specified .NET format string is applied to the control's content.

When the XlExportOptionsBase.TextExportMode property is set to Text, all control content is exported as plain text with no formatting applied.

Note

The XLSX format has priority over the .NET format. When both formats are specified for a control, the XLSX format is used when a document is exported to XLSX format.

See Export to XLSX for more information.

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