Expression Editor

This document describes the Expression Editor used for constructing expressions in the End-User Report Designer.

Expression Editor Overview

The Expression Editor provides a variety of aggregate, date-time, logical, math and string functions. You can also use logical and arithmetic operators, fields of a data source to which a report is bound, report elements, constants, and variables.

web-report-designer-expression-editor

This editor supports syntax highlighting and intelligent code completion (suggesting functions and available data elements as you type).

web-report-designer-expression-editor-code-completion

An error icon appears if an expression contains any errors. Hovering over this icon with the mouse invokes the popup indicating the error's position.

web-report-designer-expression-editor-error

Expression Syntax

Take into account the following syntax conventions when using the Expression Editor:

  • Reference a data field in the expression by enclosing its name in the square brackets (for example, [ProductName]).
  • Insert report parameters using the "Parameters." prefix before their names (for instance, [Parameters.parameter1]).
  • Reference query parameters by typing a question mark before their names (for instance, ?parameter1).
  • Denote string values with apostrophes. Type a double apostrophe to embed an apostrophe into an expression's text (for example, 'It''s sample text').
  • Enclose date-time constants with hashtags ([OrderDate] >= #1/1/2016#).
  • Use a question mark to specify a null reference (one that does not refer to any object) ([Region] != ?).
  • If an expression involves the use of different types, you can convert them to the same type using dedicated functions (for instance, Max(ToDecimal([Quantity]),[UnitPrice])).

Using the Expression Editor

When expression bindings are enabled in your reports, the Report Designer contains the Expressions tab allowing you to assign values to various element properties. Clicking any property's ellipsis button invokes the Expression Editor, in which you can specify custom expressions with the available data fields.

web-report-designer-expressions-tab

In the legacy binding mode, you can use the Expression Editor in the following cases: