In the Report Designer you can use an expression to set the value of a control in the report, or set conditions under which certain styles apply. You can define expressions in:
Expressions use the ActiveReportsJS expression syntax: an expression is enclosed in curly braces { }, and anything outside the braces is treated as literal text. For example, the expression for a field value for a TextBox is set as follows:
{Room}
You can build expressions quickly using the Expression Editor dialog. This dialog allows you to choose from a number of fields available to the report as well as to a particular property.
You can access the Expression Editor from nearly any property of a control, using the button at the right of the property row in the Properties panel.

There are the following types of fields available in the Expression Editor:
The Expression Editor dialog is composed of two panes, Fields and Expression.
The expression appears as the property value in the properties grid.
In its raw form, your data may not be ideally suited for display in a report. You can customize and manipulate data to make it perform and display in ways that suit your needs using expressions. Following are some examples of how expressions are set in different scenarios.
Because anything outside the curly braces is literal text, the easiest way to combine fields with strings is to mix text and expressions in the same value. For example, use the following to get a result that reads "System: Auditorium - Audio System".
System: {Room} - {System} System
This example takes the hardcoded string "System: ", adds the value of the Room field, then adds another string " - ", then the value of the System field, then finishes with the string " System".
Within a single expression you can also concatenate (or 'add') strings and fields using the & operator; the following produces the same result:
{"System: " & Room & " - " & System & " System"}
You can use expressions in properties like Color, Font, Border etc. to return different values based on a condition e.g. to highlight a part of your data. The formula for conditional formatting is:
{IIF(YourFieldName operator "Value to compare", "use this value if true", "use this value if false")}
For example, if you enter the following expression in the Font > FontWeight property of a textbox that displays information about a product, you will get bold text if the product's Type Attribute has the value "New".
{IIF(Type = "New", "Bold", "Normal")}
You can use a number of aggregate and other functions in your expressions. The Report Designer includes a range of functions, including running value, population standard variance, standard deviation, count, minimum and maximum. For example, use the following expression to get a count of products with the same Model Number.
{Count([Model Number])}
The general expression forms, for field values and for aggregates on field values, are:
{<FieldName>} or {[<FieldName>]}
{<Aggregate>(<FieldName>)} or {<Aggregate>([<FieldName>])}
The square-bracket form is required when the field name contains spaces or other special characters, as in the Model Number example above.
Besides field references, you can also reference report parameters as {@Param} and Globals as {&Value}, such as {&PageNumber} — see Common Values.
Common Values are run time values available to every property in every report. You can directly drag and drop these common values from the Common Values node of the Data panel onto the design surface or add and modify the values from the Expression Editor. Following is a list of the values that you can see under the Common Values node.
| Value | Description | Expression |
|---|---|---|
| Page N of M | Gets both the current page and the total number of pages in the report. |
Page {&PageNumber} of {&TotalPages} |
| Page N of M (Section) | Gets both the current page and the total number of pages in the report section. |
Page {&PageNumberInSection} of {&TotalPagesInSection} |
| Current Date and Time | Gets the date and time when the report began to run. |
{&ExecutionTime} |
| Page Number | Gets the current page number in the report. |
{&PageNumber} |
| Page Number (Section) | Gets the current page number in the report section. |
{&PageNumberInSection} |
| Total Pages | Gets the total number of pages in the report. |
{&TotalPages} |
| Total Pages (Section) | Gets the total number of pages in the report section. |
{&TotalPagesInSection} |
| Report Name | Gets the name of the report. |
{&ReportName} |
Information about the current user and project is available from the User and Project datasets — see Datasets.
You can use a function in an expression to perform actions on data in data regions, groups and datasets. You can access these functions in the Expression Editor dialog, which you can open from any property that accepts expressions using the button at the right of the property row.
Within the Expression Editor dialog, there is a tree view of Fields. Expand the Common Functions node to view the available functions. The following tables contain details about each of the functions included in the Report Designer for use in property expressions.
These are ActiveReportsJS date and time functions. See the ActiveReportsJS Date and Time Functions topic for information on overloads for each method.
These are all the available aggregate functions:
| Function | Description | Syntax and Example |
|---|---|---|
| DateAdd | Returns a date and time value that is the result of adding the interval to the date and time field of the specified unit. | DateAdd(<Interval>,<Number>,<DateTime>)
{DateAdd("d", 5, SaleDate)} |
| DateDiff | Returns the difference between the start date and time and end date and time of the specified unit. | DateDiff(<Interval>,<DateTime1>,<DateTime2>[,<FirstDayOfWeek>[,<FirstWeekOfYear>]])
{DateDiff("yyyy", SaleDate, "1/1/2015")} |
| DatePart | Returns the Integer value that represents the specified part of the given date. | DatePart(<Interval>,<DateTime>[,<FirstDayOfWeek>[,<FirstWeekOfYear>]])
{DatePart("m", SaleDate)} |
| DateSerial | Returns a Date value that represents a specified year, month, and a day, with the time information set to midnight (00:00:00). | DateSerial(<Year Number>,<Month Number>,<Day Number>)
{DateSerial(DatePart("yyyy", SaleDate)-10, DatePart("m", SaleDate)+5, DatePart("d", SaleDate)-1)} |
| DateString | Returns the String value that represents the current date in your system. | DateString()
{DateString()} |
| DateValue | Returns a Date value that contains the information on date represented by a string, with the time set to midnight (00:00:00). | DateValue(<StringDate>)
{DateValue("December 12, 2015")} |
| Now | Returns the current date and time in your system. | Now()
{Now()} |
| Today | Returns a Date value that contains the current date in your system. | Today()
{Today()} |
| Day | Returns an Integer value from 1 through 31 that represents the day of the month. | Day(<DateTime>)
{Day(SaleDate)} |
| Hour | Returns an Integer value from 0 through 23 that represents the hour of the day. | Hour(<DateTime>)
{Hour(SaleDate)} |
| Minute | Returns an Integer value from 0 through 59 that represents the minute of the hour. | Minute(<DateTime>)
{Minute(SaleDate)} |
| Month | Returns an Integer value from 0 through 12 that represents the month of the year. | Month(<DateTime>)
{Month(SaleDate)} |
| MonthName | Returns the name of the month specified in the date as a String. | MonthName(<Month Number>[,<Abbreviate>])
{MonthName(Month(SaleDate))} |
| Second | Returns an Integer value from 0 through 59 that represents the second of the minute. | Second(<DateTime>)
{Second(SaleDate)} |
| TimeSerial | Returns a Date value that represents a specified hour, minute, and second, with the date information set relative to January 1 of the year 0001. | TimeSerial(<Hour Number>, <Minute Number>, <Second Number>)
{TimeSerial(DatePart("h", SaleDate), DatePart("n", SaleDate), DatePart("s", SaleDate))} |
| TimeValue | Returns a Date value that contains the information on time represented by a string, with the date set to January 1 of the year 0001. | TimeValue(<StringTime>)
{TimeValue("15:25:45")}; {TimeValue(SaleDate)} |
| TimeOfDay | Returns a Date value containing the current time of day in your system. | TimeOfDay()
{TimeOfDay()} |
| Timer | Returns a Double value that represents the number of seconds elapsed since midnight. | Timer()
{Timer()} |
| TimeString | Returns the String value that represents the current time of day in your system. | TimeString()
{TimeString()} |
| Weekday | Returns an Integer value that contains a number representing the day of the week. | Weekday(<DateTime>[,<FirstDayOfWeek>])
{Weekday(SaleDate, 0)} |
| WeekdayName | Returns a String value that contains the name of the specified weekday. | WeekdayName(<WeekDay>[,<Abbreviate>[,<FirstDayOfWeek>]])
{WeekdayName(3, true, 0)}; {WeekdayName(Weekday(SaleDate), true, 0)} |
| Year | Returns an Integer value from 1 through 9999 representing the year. | Year(<DateTime>)
{Year(SaleDate)} |
| Quarter | Returns an Integer value from 1 through 4 representing the quarter number. | Quarter(<DateTime>)
{Quarter(SaleDate)} |
| QuarterName | Returns a string value representing the quarter name. | QuarterName(<DateTime>)
{QuarterName(SaleDate)} |
These are ActiveReportsJS math functions. See the ActiveReportsJS Math Functions topic for information on overloads for each method.
| Function | Description | Syntax and Example |
|---|---|---|
| Abs | Returns the absolute or positive value of a single-precision floating-point number. | Abs(<Number>)
{Abs(-5.5)}; {Abs(YearlyIncome-80000)} |
| Acos | Returns the angle whose cosine is the specified number. | Acos(<Number>)
{Acos(.5)}; {Acos(Angle)} |
| Asin | Returns the angle whose sine is the specified number | Asin(<Number>)
{Asin(.5)}; {Asin(Angle)} |
| Atan | Returns the angle whose tangent is the specified number. | Atan(<Number>)
{Atan(.5)}; {Atan(Angle)} |
| Atan2 | Returns the angle whose tangent is the quotient of two specified numbers. | Atan2(<Number1>,<Number2>)
{Atan2(3,7)}; {Atan2(CoordinateY,CoordinateX)} |
| BigMul | Returns the multiplication of two 32-bit numbers. | BigMul(<Number1>,<Number2>)
{BigMul(4294967295,-2147483647)}; {BigMul(Int32Value, Int32Value)} |
| Ceiling | Returns the smallest integer greater than or equal to the specified double-precision floating-point number. | Ceiling(<Number>)
{Ceiling(98.4331)}; {Ceiling(AnnualSales / 6)} |
| Cos | Returns the cosine of the specified angle. |
Cos(<Number>) {Cos(60)} |
| Cosh | Returns the hyperbolic cosine of the specified angle. | Cosh(<Number>)
{Cosh(60)} |
| E | Returns the value of E, which is 2.71828182845905. | E
{E*2} |
| Exp | Returns e raised to the specified ^, where is Euler s number. It is the inverse of the Log function. | Exp(<Number>)
{Exp(3)}; {Exp(IntegerCounter)} |
| Fix | Returns the integer portion of a number. | Fix(<Number>)
{Fix(-7.15)}; {Fix(AnnualSales / -5)} |
| Floor | Returns the longest integer less than or equal to the specified double-precision floating-point number. | Floor(<Number>)
{Floor(4.67)}; {Floor(AnnualSales / 12)} |
| IEEERemainder | Returns the remainder after division of one number by another according to IEEE standards. | IEEERemainder(<Number1>,<Number2>)
{IEEERemainder(9,8)} |
| Log | Returns the logarithm of the specified number. | Log(<Number>)
{Log(20.5)}; {Log(NumberValue)} |
| Log10 | Returns the logarithm of the specified number to the base 10. | Log10(<Number>)
{Log10(20.5)}; {Log10(NumberValue)} |
| PI | Returns the value of PI, which is 3.14159265358979. | PI
{2 * PI * Radius} |
| Pow | Returns one number raised to the ^ of another number. | Pow(<Number1>,<Number2>)
{Pow(Quantity, 2)} |
| Round | Returns the round-off of a decimal number to the nearest integer or to the nearest decimal number up to the specified digits. | Round(<Number>)
{Round(12.456)}; {Round(AnnualSales / 12.3)} |
| Sign | Returns a value indicating the sign of an 8-bit signed integer. | Sign(<Number>)
{Sign(AnnualSales-60000)} |
| Sin | Returns the sine of the specified number. | Sin(<Number>)
{Sin(60)} |
| Sinh | Returns the hyperbolic sine of the specified angle. | Sinh(<Number>)
{Sinh(60)} |
| Sqrt | Returns the square root of the specified number. | Sqrt(<Number>)
{Sqrt(121)} |
| Tan | Returns the tangent of the specified number. | Tan(<Number>)
{Tan(60)} |
| Tanh | Returns the hyperbolic tangent of the specified angle. | Tanh(<Number>)
{Tanh(60)} |
These are ActiveReportsJS functions. See the ActiveReportsJS Functions topic for information on overloads for each method.
| Function | Description | Syntax and Example |
|---|---|---|
| IsArray | Returns True if the expression can be evaluated as an array. | IsArray(<Expression>)
{IsArray(@Initials)} |
| IsDate | Returns True if the expression represents a valid Date value. | IsDate(<Expression>)
{IsDate(BirthDate)}; {IsDate("31/12/2010")} |
| IsNothing | Returns True if the expression evaluates to nothing. | IsNothing(<Expression>)
{IsNothing(MiddleInitial)} |
| IsNumeric | Returns True if the expression can be evaluated as a number. | IsNumeric(<Expression>)
{IsNumeric(AnnualSales)} |
These are ActiveReportsJS functions. See the ActiveReportsJS Decision Functions topic for more information.
| Function | Description | Syntax and Example |
|---|---|---|
| Choose | Returns a value from a list of arguments. | Choose(<Index>,<Value>[, <Value2>,...[, <Value N>]])
{Choose(3, "10", "15", "20", "25")} |
| IIF | Returns the value if the expression evaluates to True, and the second value if the expression evaluates to False. | IIF(<Condition>, <TruePart>, <FalsePart>)
{IIF(AnnualSales >= 80000, "Above Average", "Below Average")} |
| Partition | Returns a string (in the form x : y) that represents the calculated range based on the specified interval containing the specified number. | Partition(<Value>, <Start>, <End>, <Interval>)
{Partition(1999, 1980, 2000, 10)} |
| Switch | Returns the value of the first expression that evaluates to True among a list of expressions. | Switch(<Condition1>, <Value1>[, <Condition2>, <Value2>,...[,<ConditionN>, <ValueN>]])
{Switch(FirstName = "Abraham", "Adria", FirstName = "Charelotte", "Cherrie")} |
You can use aggregate functions within report control value expressions to accrue data. For all of the functions, you can add an optional <Scope> argument, passed as a string — see Using the Scope Argument below.
These are all the available aggregate functions:
These are ActiveReportsJS conversion functions. See the ActiveReportsJS Conversion Functions topic for more information.
| Function | Description | Syntax and Example |
|---|---|---|
| ToBoolean | Converts the specified value to Boolean. | ToBoolean(<Value>)
{ToBoolean(HouseOwnerFlag)} |
| ToByte | Converts the specified value to Byte. | ToByte(<Value>)
{ToByte(ProductNumber)} |
| ToDateTime | Converts the specified value to a Date and Time value. | ToDateTime(<Value>)
{ToDateTime(SaleDate)}; {ToDateTime("1 January, 2017")} |
| ToDecimal | Converts the specified value to Decimal. | ToDecimal(<Value>)
{ToDecimal([Cost Price])} |
| ToDouble | Converts the specified value to Double. | ToDouble(<Value>)
{ToDouble(AnnualSales)}; {ToDouble(535.85 * .2691 * 67483)} |
| ToInt16 | Converts the specified value to a 16-bit signed Integer. | ToInt16(<Value>)
{ToInt16(AnnualSales)}; {ToInt16(535.85)} |
| ToInt32 | Converts the specified value to a 32-bit signed Integer. | ToInt32(<Value>)
{ToInt32(AnnualSales)} |
| ToInt64 | Converts the specified value to a 64-bit signed Integer. | ToInt64(<Value>)
{ToInt64(AnnualSales)} |
| ToSingle | Converts the specified value to a single-precision floating-point number. | ToSingle(<Value>)
{ToSingle(AnnualSales)}; {ToSingle(15.857692134)} |
| ToUInt16 | Converts the specified value to a 16-bit unsigned Integer. | ToUInt16(<Value>)
{ToUInt16(AnnualSales)} |
| ToUInt32 | Converts the specified value to a 32-bit unsigned Integer. | ToUInt32(<Value>)
{ToUInt32(AnnualSales)} |
| ToUInt64 | Converts the specified value to a 64-bit unsigned Integer. | ToUInt64(<Value>)
{ToUInt64(AnnualSales)} |
The Report Designer also offers several functions which do not aggregate data, but which you can use with an IIF function to help determine which data to display or how to display it.
| Function | Description | Syntax and Example |
|---|---|---|
| Level | Returns the level of the current value in a recursive hierarchy. | Level()
{Level()} |
| Previous | Returns the previous value within the indicated scope. | Previous(<Value>)
{Previous(OrderID)} |
| RowNumber | Shows a running count of all the rows in the scope returned by the expression. | RowNumber()
{RowNumber()} |
| Lookup | Returns the first matching value for the specified name from the dataset with pairs of name and value. | Lookup(<SourceExpression>, <DestinationExpression>, <ResultExpression>, <LookupDataset>)
{Lookup(ProductID, ProductID, Quantity, "DataSet2")} |
| LookupSet | Returns multiple row values from a specified dataset and can be used for the 1-to-many relationship. | LookupSet(source_expression, destination_expression, result_expression, dataset)
{LookupSet(CategoryID, CategoryID, UnitsInStock, "Products")} |
| GroupIndex | Returns the index of the element in the current group. | {GroupIndex()} |
| GroupIndex (with scope) | Returns the index of the element in the specified group. | {GroupIndex(<Group>)} |
All functions have a Scope argument which determines the grouping, data region, or dataset to be considered when calculating the aggregate or other function. By default — when the Scope argument is omitted — the calculation scope is the current scope: within a data region, this is the innermost grouping to which the report control belongs. To calculate over a different scope, pass the name of a grouping, dataset, or data region as a string. For example, in a table containing a group named Room:
{Sum([Cost Price], "Room")}
totals the cost price over the current Room group, wherever the expression is placed.
The Scope argument must name a data region, grouping, or dataset that directly or indirectly contains the report control using the function in its expression. If the report control is outside of a data region, the Scope argument refers to a dataset. If there is only one dataset in the report, you can omit the Scope argument. If there are multiple datasets, you must specify which one to use to avoid ambiguity.