Expressions

An expression is a string which defines a formula or criteria, that's evaluated at runtime. The expression may be a combination of variables, constants, strings, dates and operators/functions. For instance 1000 format `` gets 1,000.00 for US format, while 1.000,00 is displayed for German format.

  

When working with dynamic data in tables, grids, reports, or hierarchical structures, it is often necessary to determine the position of each item within its context. The ConditionalFormat, ComputedField, FormatColumn, and FormatCell objects support a variety of auto-number expressions that help with numbering, tracking, and identifying item positions dynamically. These expressions allow for improved formatting, sorting, analysis, and conditional logic based on the placement of items.

The ConditionalFormat, ComputedField, FormatColumn, and FormatCell objects support auto-number expressions for items in the following ways:

  1. number index 'format', indicates the index of the item. The first added item has an index of 0, the second added item has an index of 1, and so on. The index of an item remains the same even if the order of the items is changed by sorting. For example, 1 index '' starts the index from 1, while 100 index '' starts the index from 100. The number represents the starting index, and the format defines the character set to be used for specifying the index. If the format is not provided, the index is represented as numbers. For instance, 1 index 'A-Z' results in the index being formatted as A, B, C... Z, BA, BB, BZ, CA, etc. Similarly, 1 index 'abc' formats the index as: a, b, c, ba, bb, bc, ca, cb, cc, and so on. You can also use other number formatting functions to modify the returned value. For example, 1 index '' format '0||2|:' groups the numbers into pairs of digits, separated by a colon character.
  2. number pos 'format' indicates the position of the item. The position represents the placement of a visible child item within its parent’s collection of children. The number defines the starting position, while the format consists of characters that specify how the position should be represented. For example, 1 pos '' retrieves the position starting from 1, whereas 100 pos '' retrieves the position starting from 100. If no format is provided, the position is displayed as a numerical value. The key difference between pos and opos becomes evident when filtering items in the control, as opos retains the original position before filtering, while pos reflects the updated position within the visible subset. For example, when no filter is applied to the control, pos and opos return the same value. However, when a filter is applied, opos retains the item's original position in the complete, unfiltered list, while pos reflects the item's new position within the filtered list.
  3. number opos 'format' indicates the old position of the item. The old position represents the placement of a child item within its parent’s collection before any changes, such as reordering or filtering. The number defines the starting position, while the format consists of characters specifying how the position should be represented. For example, 1 opos '' retrieves the old position starting from 1, while 100 opos '' retrieves it starting from 100. If no format is provided, the old position is displayed as a numerical value. This differs from pos, which reflects the updated position after modifications. The difference between pos and opos becomes apparent when filtering items in the control. For instance, when no filter is applied, both pos and opos will return the same result, as the items are in their original order. However, when a filter is applied:
    opos retains the item's original position in the unfiltered list, reflecting its place before the filter was applied.
    pos updates to show the item’s position within the filtered list, based on the visible subset after filtering.

These operators can be used in combination with predefined constants, operators, and functions as outlined here.

Usage examples:

.