Use Expressions

  • 2 minutes 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.

See the Data Binding Modes topic for details on the available binding modes.

Expression Editor

The Report Designer's Expression Editor provides functions, operators, data source fields, report elements, constants, and variables to construct expressions.

Expressions_ExpressionEditor

The Expression Editor highlights an expression's syntax and supports intelligent code completion (it suggests functions and available data elements as you type).

Expressions_ExpressionEditor_Intellisense

The Expression Editor displays all the errors it finds in the specified expression.

Expressions_ExpressionEditor_ErrorValidation

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.

Expressions_FilterEditor

The FilterString Editor highlights an expression's syntax and supports intelligent code completion (it suggests functions and available data elements as you type).

FilterEditor_New_Features