Using the PXML expression language

Genero Report Writer provides the PXML Expression language to define the value of a property that is of the PXML (dimension) type. The type of each property is specified in the Properties page of the Report Writer documentation.

A PXML expression always yields a Numeric value. The value is expressed in units of measurement. It is legal, for example, for the value to be 10in. If no unit is specified, the unit is presumed to be points. When you specify a value in units, it is converted internally to its equivalent value in points.

Units of Measure

The most commonly used units are:

See Dimension Resolver for additional explanations and examples of the units that can be used.

Variables

These variables can be used in any PXML expression to define the layout dynamically:

For example, to center an element in its parent container you can use the max variable for these properties:

Table 1. Centering an element
Property Value
x max/2
y max/2
anchorx 0.5
anchory 0.5

You can use the rest variable in the Y-Size property of a MiniPage container to force a page break by consuming the remainder of the container:

Table 2. Using rest
Property Value
Y-Size rest

Functions

The PXML Expression language has a 4GL-like syntax. The most commonly used functions are:

For example, this expression uses the functions max and width :
max(10cm,width("HELLO"))

It first calculates the width of the string "HELLO", taking the current font metrics into account. Next, it compares the value "10cm" and the width of "HELLO", and returns the larger value.