Legacy format strings are like in C, but not always identical.
To print a string, the %s
format string can be used.
Examples for using it in the
Text element format attribute can be found in the
Format attribute examples.
Example expressions for the format() function:
format(query1.field1, '%s') format(query1.field1, 'Look, there is a %s there!')
Example expressions for printf function:
printf('%s, 'query1.field1') printf('Look, there is a %s there!', query1.field1)
Supplementary format string flags are supported. See the string flags in printf(3)
To print a number, the %d
format string can be used. As opposed to the
C printf
format specifier
where %d
is used for integers,
this is used for printing fractions, too.
Examples for using it in the
Text element format attribute can be found in the
Format attribute examples.
The same format string can be used for the the format() function and the printf function, just like in the previous examples for strings.
Supplementary format string flags are supported. See the decimal and float/double format flags in printf(3)
RLIB approximated strftime()
when printing a datetime value. OpenCReports
uses strftime()
.
See the
strftime()
function description for the complete description of
format string flags.
When a datetime field didn't have an explicit format string, RLIB used the US date format to print the datetime value. On the other hand, OpenCReports uses the locale specific date format if the report has a locale set.