TextFormatExpression

Description

Uses a java.text.MessageFormat to format a string message. It will concatenate and format one or more values evaluated from an expression, function or report data source.

The TextFormatExpression uses the pattern property to define the global format-pattern used when evaluating the expression. The data row fields used to fill the expressions placeholders are defined in a list of properties where the property-names are numbers.

The property counting starts at "0".

The Syntax of the pattern property is explained in java.text.MessageFormat.

Example

<expression name="expr" class="org.jfree.report.function.TextFormatExpression">
 <properties>
   <property name="pattern">Invoice for your order from \{0, date, EEE, MMM d, yyyy\}</property>
   <property name="fields\[0\]">printdate</property>
 </properties>
</expression>

<expression class="org.jfree.report.function.TextFormatExpression" name="leader.name">
  <properties>
    <property name="pattern">{0} {1}</property>
    <property name="field[0]">leader.firstName</property>
    <property name="field[1]">leader.lastName</property>
  </properties>
</expression>