Using property conditional expressions

As with other DataWindow objects, you can specify property conditional expressions to modify properties at runtime. You can use them with either dynamic or static crosstabs. With dynamic crosstabs, you specify an expression once for a column or value, and PowerBuilder assigns the appropriate properties when it builds the individual columns at runtime. With static crosstabs, you have to specify an expression for each individual column or value, because the columns are already specified at definition time.

Example

In the following crosstab, an expression has been specified for Units:

The sample shows the Design view for a DataWindow with the units column selected. Superimposed on this is a dialog box labeled units dot Font dot Weight. Under Expression : is displayed the expression if ( units > 100, 700, 400. Under this is a box listing available functions and a box listing the columns product, units, and grand _ sum _ units.

The expression is for the Font.Weight property of the units column:

if (units > 100, 700, 400)

The expression specifies to use bold font (weight = 700) if the number of units is greater than 100. Otherwise, use normal font (weight = 400).

This is the crosstab at runtime:

The sample has the headings Sum of Units and Quarter. Below them is a column heading for Product, a column heading for each quarter, and a grand total column. At the bottom of the crosstab are grand totals for all products for each quarter. Data is shown for three sample products, Cosmic, Galactic, and Stellar. The figures for the Cosmic product for Q two, three, and four are 104, 134, and 160,  and are therefore displayed in bold font.

Values larger than 100 are shown in bold.

For more information about property conditional expressions, see Chapter 24, “Highlighting Information in DataWindow Objects.”