This report shows a typical advertising letter praising the latest offerings from a local computer store. It is a variation of the 'invoice' type demos.
The report definition uses a message-field tag to concat strings
within an element.
<message-field name="customer.salutationExpression"
x="0" y="290" width="450" height="12"
alignment="left" fontstyle="plain" fontsize="11"
>Dear $("customer.salutation") $("customer.lastName")</message-field>
A message field will print the current values for the given datarow column
names
whenever the underlying band is printed. As the implementation uses a
java.text.MessageFormat object to actually generate the contents
for
the element, you can also add additional message format arguments:
<message-field name="invoice.date"
x="75%" y="224" width="25%" height="12"
alignment="right" fontstyle="plain"
>$("ad.date",date,"yyyy-MM-dd")</message-field>
If the article description is empty, it is hidden using a custom function. As usual in such cases, the element to be hidden is referenced by its name.