[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
  [Collapse]Provide Data to Reports
   [Expand]Bind a Report to a Data Source
   [Collapse]Bind Report Controls to Data
     Data Binding Modes Comparison
     Bind Report Controls to Data (Expression Bindings)
     Bind Report Controls to Data (Legacy Data Bindings)
     Use Embedded Fields (Mail Merge)
     Update Report Data Bindings
  [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
  [Expand]Store and Distribute 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)

Bind Report Controls to Data (Expression Bindings)

This topic describes how to bind report controls to data fields in the expression bindings mode.

Expanded Bind Report Controls at Design Time

After connecting a report to data, the Field List panel displays the data source's hierarchy and provides access to the available data fields. This panel allows you to bind report controls to data in all binding modes.

Dropping a data field onto a report's surface creates a new report control bound to the corresponding field.

Dropping a data field onto an existing control binds this control to the corresponding field.

See the Field List document for more information about using this panel for data binding.

Note that while binding, the field is assigned to the control's property with the DefaultBindableProperty attribute (usually, XRControl.Text).

You can also bind a control to the calculated fields and report parameters, and combine static and dynamic content in the same control (for instance, to append a text prefix or postfix to a value obtained from a database).

When the UserDesignerOptions.DataBindingMode is set to DataBindingMode.Expressions or DataBindingMode.ExpressionsAdvanced, a report uses expressions to provide data to controls. In these modes, the Properties grid contains the Expressions tab. This tab provides properties that you can specify using expressions with available data fields.

You can also access expressions for the most popular properties using the control's smart tag. Clicking the property's ellipsis button invokes the Expression Editor in which you can specify the required data field or construct a complex binding expression involving two or more data fields.

You do not need to run the Expression Editor if you want to bind a report control to a single data field. Click the control's smart tag, invoke the Expression's drop-down list and select the required field.

After you bind the report control to data, you can format the control's values using the Format String option (the XRControl.TextFormatString property).

You can also use a binding expression to shape report data (for instance, calculate summary results or conditionally format data). See the Shape Data (Expression Bindings) documentation section for more information.

Expanded Bind Report Controls at Runtime

The XRControl.ExpressionBindings property provides access to the control's expression bindings. An ExpressionBinding object implements each expression binding's functionality and contains the following settings:

You can specify a report control's binding expression at runtime by creating an ExpressionBinding object with the required settings and adding it to the XRControl.ExpressionBindings collection. The following code snippet demonstrates how to specify a custom expression for a label's XRControl.Text property.

Expanded See Also

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