Report Expression

  1. To place a field control on the Report Designer canvas, click the Define Field and Expression tool , then click the point on the screen at which to display the left side of the field control.
  2. Drag the mouse pointer to define the size of the newly defined field control. When you release the mouse, the Report Expression window displays.

  1. To define an expression, click the ellipsis button next to the Expression field. Here you can select a field or build a more complex evaluative statement. See Expression Builder for more information.

    Note: Rather than clicking the ellipsis to open Expression Builder, you could type the name of the field in the space available. The file structure for your report provides you with a list of available field names.
  2. To format this item, click the ellipsis button next to the Format field. The Format window displays.

    Note: Any changes made to format will not be visible in Report Designer, but will be applied to the report output.
    1. If desired, type a format expression in the Format field.
    2. Select whether data entered in this field is Character, Numeric, or Date.
    3. Select the desired Editing options. These editing options perform the same function as some of the most common format expressions listed below. You can select one of these radio buttons as an alternative to typing the format expression.
      • To upper case: Automatically convert all text data to upper case.
      • Ignore input mask: Not implemented in TAM.
      • SET DATE format: Apply standard date format to date fields.
      • British date: Apply British date format to date fields.
      • Left justify
      • Right justify
      • Center justify
    4. When you have finished making selections on the Format window, click OK.
  3. Select the desired option in the Field position frame:
  4. If you wish for this field to expand on the canvas in order to fit the data entered, select Stretch with overflow.
  5. Enter any applicable comments in the Comment field.
  6. To perform calculations based on the data entered in this field, click Calculations. The Calculate Field window displays.
    1. Determine whether you would like values used in the calculations to be reset at the End of Report, End of Page, or End of Column. You can also select any data groups existing in your report. See Data Grouping.
    2. Select the appropriate option from the Calculate frame.
      • Nothing: Performs no additional calculations on the data.
      • Count: Displays a count of the number of times the field or expression indicated occurs (does not actually calculate the value for the expression).
      • Sum: Displays a total of the values for the specified field.
      • Average: Displays an average of the values for the specified field.
      • Lowest: Displays the lowest value included for the field.
      • Highest: Displays the highest value included for the field.
      • Standard deviation: Displays the square root of the variance (the amount that the field values vary from the average value).
      • Variance: Displays the amount that the field values vary from the average value.
    3. Click OK to return to the Report Expression window.
  7. To determine when this field should print, click Print When.
  8. When you have finished defining the field/expression, click OK.

Format Expression

A format expression consists of Input Mask characters, which represent the data in the field, and Format Code characters, which precede the Input Mask characters and apply additional formatting to the data.

Input Mask characters include:

Character Represents
# Numeric character, space, or sign (such as the minus sign)
$ Currency symbol
, Digit separator
. Decimal point
9 Numeric character or sign (such as the minus sign)
A Alphabetic character
U Alphabetic character, forces uppercase
W Alphabetic character, forces lowercase
X Any character

Format Code characters are always preceded by an @ symbol and include:

Character Function
B Left justify
J Right justify
I Center justify
L Include leading zeroes
Z Blank if zero
( Surround negative numbers with parentheses
C Add CR to positive non-zero numbers
X Add DB to negative non-zero numbers
D Use current SET DATE setting
E Use SET DATE BRITISH
YL Display dates using Long Date format
YS Display dates using Short Date format
R Prevent characters in the formatting expression from overriding data characters (see Examples table below)

Note: You can include multiple Format Code characters in a format expression.

Examples:

Data Input Format Expression Data Output
8009995368 (999) 999-9999 (009) 536-
8009995368 @R (999) 999-9999 (800) 999-5368
-25.98 @(L 999.99 (025.98)
-25.98 @CX 999.99 25.98 DB
il60484 UU 99999 IL 0484
il60484 @R UU 99999 IL 60484