Use Expressions and Shape Data (Expression Bindings)
Use Expressions
- Nov 26, 2019
- 2 min to read
Use expressions to retrieve and format data, create calculated fields and calculate summaries, conditionally shape data and change a report control's appearance.
#Expression Syntax
An expression is a string that is parsed and processed to evaluate a value. Expressions consist of field names, constants, operators, and functions. Field names are wrapped in square brackets.
"[Quantity] * [UnitPrice] * (1 - [BonusAmount])"
"[FirstName] + ' ' + [LastName]"
"[Country] == 'USA'"
"[OrderDate] > #8/16/1994# AND [Quantity] > 20"
You can use operators, functions, and constants in your expressions.
Refer to the CustomFunctions class description for information on how to implement custom expression functions in reporting applications.
#Expression Editor
The Report Designer's Expression Editor provides functions, operators, data source fields, report elements, constants, and variables to construct expressions.
The Expression Editor highlights an expression's syntax and supports intelligent code completion (it suggests functions and available data elements as you type).
The Expression Editor displays all the errors it finds in the specified expression.
#FilterString Editor
The Report Designer's FilterString Editor allows you to specify the FilterString property of a report, XRCrossTab, or XRChart's Series.
The FilterString Editor provides a visual interface where you can use an unlimited number of conditions and combine them with logical operators to create filter criteria. You can also switch to the Text mode and type a filter string.
The FilterString Editor highlights an expression's syntax and supports intelligent code completion (it suggests functions and available data elements as you type).
Shape Data (Expression Bindings)
- Apr 19, 2019
Tutorials in this section describe how to shape and display report data.
TIP
See Data Binding Modes for more information about the available bind modes.
See Shaping Data (Legacy Data Bindings) for alternative ways to shape report data.
The following tutorials are available:
- Format Data
- Conditionally Change a Control's Appearance
- Conditionally Change a Label's Text
- Conditionally Filter Report Data
- Conditionally Suppress Controls
- Limit the Number of Records per Page
- Conditionally Change a Band's Visibility
- Calculate a Summary
- Calculate an Advanced Summary
- Calculate a Weighted Average
- Display Row Numbers in a Report, Group or Page
- Count the Number of Records in a Report or Group
- Count the Number of Groups in a Report