[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
 [Expand]Detailed Guide to DevExpress Reporting
 [Expand]Visual Studio Report Designer
 [Expand]Creating End-User Reporting Applications
 [Collapse]API Reference
  [Expand]DevExpress.XtraCharts
  [Expand]DevExpress.XtraPrinting.Caching
  [Expand]DevExpress.XtraReports
  [Expand]DevExpress.XtraReports.Configuration
  [Expand]DevExpress.XtraReports.Data
  [Expand]DevExpress.XtraReports.Design
  [Expand]DevExpress.XtraReports.Expressions
  [Expand]DevExpress.XtraReports.Extensions
  [Expand]DevExpress.XtraReports.Localization
  [Expand]DevExpress.XtraReports.Native
  [Expand]DevExpress.XtraReports.ReportGallery
  [Expand]DevExpress.XtraReports.ReportGeneration
  [Expand]DevExpress.XtraReports.Security
  [Expand]DevExpress.XtraReports.Serialization
  [Expand]DevExpress.XtraReports.Service
  [Expand]DevExpress.XtraReports.Service.Extensions
  [Expand]DevExpress.XtraReports.Templates
  [Collapse]DevExpress.XtraReports.UI
   [Expand]Band Class
   [Expand]BandCollection Class
   [Expand]BandEventArgs Class
    BandEventHandler Delegate
   [Expand]BandFactory Class
    BandKind Enumeration
   [Expand]BandScripts Class
   [Expand]BestSizeEstimator Class
   [Expand]BindingEventArgs Class
    BindingEventHandler Delegate
   [Expand]BottomMarginBand Class
   [Expand]CalculatedField Class
   [Expand]CalculatedFieldCollection Class
   [Expand]CalculatedFieldScripts Class
   [Expand]ChangeEventArgs Class
    ChangeEventHandler Delegate
    ChartImageType Enumeration
   [Expand]CheckEditOptions Class
    ColumnDirection Enumeration
    DataBindingMode Enumeration
   [Expand]DataSourceRowEventArgs Class
    DataSourceRowEventHandler Delegate
   [Expand]DesignerOptions Class
    DesignWindowType Enumeration
   [Expand]DetailBand Class
   [Expand]DetailReportBand Class
   [Expand]DetailReportBandCollection Class
    DocumentExportMode Enumeration
   [Expand]DrawEventArgs Class
    DrawEventHandler Delegate
   [Expand]EditOptions Class
   [Expand]ExpressionBinding Class
   [Expand]ExpressionBindingCollection Class
   [Collapse]Formatting Class
     Formatting Members
    [Expand]Formatting Constructor
    [Expand]Formatting Properties
    [Expand]Formatting Methods
   [Expand]FormattingRule Class
   [Expand]FormattingRuleCollection Class
   [Expand]FormattingRuleSheet Class
    GaugeImageType Enumeration
   [Expand]GetValueEventArgs Class
    GetValueEventHandler Delegate
   [Expand]GroupBand Class
   [Expand]GroupBandScripts Class
   [Expand]GroupField Class
   [Expand]GroupFieldCollection Class
   [Expand]GroupFooterBand Class
    GroupFooterUnion Enumeration
   [Expand]GroupHeaderBand Class
   [Expand]GroupHeaderBandScripts Class
   [Expand]GroupSortingSummaryGetResultEventArgs Class
    GroupSortingSummaryGetResultEventHandler Delegate
   [Expand]GroupSortingSummaryRowChangedEventArgs Class
    GroupSortingSummaryRowChangedEventHandler Delegate
    GroupUnion Enumeration
   [Expand]HtmlEventArgs Class
    HtmlEventHandler Delegate
   [Expand]IReportDesignTool Interface
   [Expand]MarginBand Class
   [Expand]MultiColumn Class
    MultiColumnMode Enumeration
   [Expand]PageBand Class
    PageBreak Enumeration
   [Expand]PageFooterBand Class
   [Expand]PageHeaderBand Class
   [Expand]ParameterBinding Class
   [Expand]ParameterBindingCollection Class
   [Expand]PdfStreamingExporter Class
   [Expand]PreviewMouseEventArgs Class
    PreviewMouseEventHandler Delegate
   [Expand]PrintableComponentContainer Class
   [Expand]PrintOnPageEventArgs Class
    PrintOnPageEventHandler Delegate
    ProcessDuplicatesMode Enumeration
    ProcessDuplicatesTarget Enumeration
    ProcessHiddenCellMode Enumeration
    PromptBoolean Enumeration
   [Expand]ReportDesignTool Class
   [Expand]ReportFooterBand Class
   [Expand]ReportHeaderBand Class
   [Expand]ReportPrintOptions Class
    ReportUnit Enumeration
   [Expand]ReportUnitExtensions Class
    RestrictionLevel Enumeration
    RightToLeft Enumeration
    RightToLeftLayout Enumeration
   [Expand]SaveComponentsEventArgs Class
   [Expand]SerializableString Class
    SerializationFormat Enumeration
    SnappingMode Enumeration
   [Expand]SortingOptions Class
    SortingSummaryFunction Enumeration
    SparklineImageType Enumeration
   [Expand]StyleFlagsBase Class
   [Expand]StylePriority Class
   [Expand]StyleUsing Class
   [Expand]SubBand Class
   [Expand]SubBandCollection Class
   [Expand]SubreportBase Class
   [Expand]SubreportBaseScripts Class
    SummaryFunc Enumeration
   [Expand]SummaryGetResultEventArgs Class
    SummaryGetResultHandler Delegate
    SummaryRunning Enumeration
   [Expand]TextEditOptions Class
    TextFitMode Enumeration
   [Expand]TextFormatEventArgs Class
    TextFormatEventHandler Delegate
   [Expand]TopMarginBand Class
   [Expand]TruncatedControlScripts Class
   [Expand]ValueBinding Class
    ValueSuppressType Enumeration
   [Expand]WinControlContainer Class
    WinControlDrawMethod Enumeration
    WinControlImageType Enumeration
    WinControlPrintMode Enumeration
   [Expand]WindowControlOptions Class
   [Expand]XRAppearanceObject Class
   [Expand]XRBarCode Class
    XRBarCodeOrientation Enumeration
   [Expand]XRBinding Class
   [Expand]XRBindingCollection Class
   [Expand]XRCharacterComb Class
   [Expand]XRCharacterCombScripts Class
   [Expand]XRChart Class
   [Expand]XRChartScripts Class
   [Expand]XRCheckBox Class
    XRColumnSortOrder Enumeration
   [Expand]XRControl Class
   [Expand]XRControlCollection Class
   [Expand]XRControlCollectionBase Class
   [Expand]XRControlEvents Class
   [Expand]XRControlScripts Class
   [Expand]XRControlStyle Class
   [Expand]XRControlStyleSheet Class
   [Expand]XRCrossBandBox Class
   [Expand]XRCrossBandControl Class
   [Expand]XRCrossBandControlCollection Class
   [Expand]XRCrossBandLine Class
    XRDockStyle Enumeration
   [Expand]XRFieldEmbeddableControl Class
   [Expand]XRGauge Class
   [Expand]XRGaugeScripts Class
   [Expand]XRGroupSortingSummary Class
   [Expand]XRLabel Class
   [Expand]XRLabelScripts Class
   [Expand]XRLine Class
   [Expand]XRLineScripts Class
   [Expand]XRPageBreak Class
   [Expand]XRPageBreakScripts Class
   [Expand]XRPageInfo Class
   [Expand]XRPanel Class
   [Expand]XRPanelScripts Class
   [Expand]XRPictureBox Class
   [Expand]XRPictureboxScripts Class
   [Expand]XRPivotGrid Class
   [Expand]XRPivotGridScripts Class
   [Expand]XRRichText Class
   [Expand]XRRichTextBase Class
   [Expand]XRRichTextBox Class
   [Expand]XRRichTextBoxBase Class
    XRRichTextStreamType Enumeration
   [Expand]XRScriptsBase Class
   [Expand]XRShape Class
   [Expand]XRShapeScripts Class
   [Expand]XRSparkline Class
   [Expand]XRSparklineScripts Class
   [Expand]XRSubreport Class
   [Expand]XRSummary Class
   [Expand]XRSummaryEvents Class
   [Expand]XRSummaryScripts Class
   [Expand]XRTable Class
   [Expand]XRTableCell Class
   [Expand]XRTableCellCollection Class
   [Expand]XRTableOfContents Class
   [Expand]XRTableOfContentsLevel Class
   [Expand]XRTableOfContentsLevelBase Class
   [Expand]XRTableOfContentsLevelCollection Class
   [Expand]XRTableOfContentsTitle Class
   [Expand]XRTableRow Class
   [Expand]XRTableRowCollection Class
   [Expand]XRTableScripts Class
   [Expand]XRWatermark Class
   [Expand]XRZipCode Class
   [Expand]XtraReport Class
   [Expand]XtraReportBase Class
   [Expand]XtraReportBaseScripts Class
   [Expand]XtraReportDesignerExtensions Class
   [Expand]XtraReportScripts Class
  [Expand]DevExpress.XtraReports.UI.BarCode
  [Expand]DevExpress.XtraReports.UI.PivotGrid
  [Expand]DevExpress.XtraReports.UserDesigner
  [Expand]DevExpress.XtraReports.Web
  [Expand]DevExpress.XtraReports.Web.Azure.ReportDesigner
  [Expand]DevExpress.XtraReports.Web.Azure.WebDocumentViewer
  [Expand]DevExpress.XtraReports.Web.ClientControls
  [Expand]DevExpress.XtraReports.Web.ClientControls.DataContracts
  [Expand]DevExpress.XtraReports.Web.DocumentViewer
  [Expand]DevExpress.XtraReports.Web.DocumentViewer.Ribbon
  [Expand]DevExpress.XtraReports.Web.Extensions
  [Expand]DevExpress.XtraReports.Web.Localization
  [Expand]DevExpress.XtraReports.Web.QueryBuilder
  [Expand]DevExpress.XtraReports.Web.QueryBuilder.Native
  [Expand]DevExpress.XtraReports.Web.ReportDesigner
  [Expand]DevExpress.XtraReports.Web.ReportDesigner.DataContracts
  [Expand]DevExpress.XtraReports.Web.ReportDesigner.Native
  [Expand]DevExpress.XtraReports.Web.Scripts
  [Expand]DevExpress.XtraReports.Web.WebDocumentViewer
  [Expand]DevExpress.XtraReports.Web.WebDocumentViewer.DataContracts
  [Expand]DevExpress.XtraReports.Web.WebDocumentViewer.Native
  [Expand]DevExpress.XtraReports.Wizards
  [Expand]DevExpress.XtraReports.Wizards.Builder
  [Expand]DevExpress.XtraReports.Wizards.Labels
  [Expand]DevExpress.XtraReports.Wizards.Presenters
  [Expand]DevExpress.XtraReports.Wizards.Templates
  [Expand]DevExpress.XtraReports.Wizards.Views
  [Expand]DevExpress.XtraReports.Wizards3
  [Expand]DevExpress.XtraReports.Wizards3.Presenters
  [Expand]DevExpress.XtraReports.Wizards3.Views
[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 Class

A container of values, which are applied to a control when its owner Formatting Rule's condition is true.

Namespace:DevExpress.XtraReports.UI
Assembly:DevExpress.XtraReports.v18.1.dll

Expanded Syntax

Expanded Remarks

The formatting which is defined by the current formatting rule is specified by its FormattingRule.Formatting property. The Formatting object, which is returned by this property, contains a set of appearance options (e.g. BackColor, ForeColor, Font, etc.), as well as the Visible property, that can be used to conditionally suppress report elements.

Note

If any of the Formatting object's properties is not set, the corresponding property of a control isn't changed when this formatting rule is applied.

For more information on using this property, refer to Conditionally Changing a Control's Appearance.

Note

Formatting rules are only available in the legacy binding mode (when the UserDesignerOptions.DataBindingMode is set to DataBindingMode.Bindings). See Shaping Data using Expression Bindings to learn about the recommended approach to shaping report data.

Expanded Example

This example demonstrates how to conditionally change a control's appearance at runtime. For this, it is necessary to create an instance of the FormattingRule class, specify its FormattingRule.Condition and FormattingRule.Formatting properties and add this object to a report's sheet of formatting rules (XtraReport.FormattingRuleSheet) and to the collection of formatting rules of a control or a band, to which it should be applied (XRControl.FormattingRules). Note that the same task can be also solved at design time, as described in the Conditionally Changing a Control's Appearance topic.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E939.

Expanded Inheritance Hierarchy

System.Object
    BrickStyle
       XRControlStyle
          Formatting

Expanded See Also

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