Adding Comments in JasperReports template (jrxml)

jasper-reports

Solution

Use Callouts feature in iReport Designer tool

Since iReport 3.7.1 there is an element called Callouts added especially to cater to comments provision.

Go to Window -> Pallete menu in iReport designer. These "Callouts" works like sticky notes in the iReport interface and in the generated XML it looks like this:

<property name="ireport.callouts" value="##Mon Aug 12 18:03:15 MSK 2013\ncallouts.2.text=This is Detail band\ncallouts.1.text=This is Title Band\ncallouts.2.bounds=353,118,150,75\ncallouts.1.bounds=34,17,239,83"/>

In GUI designer (iReport) notes look like:

For more details look at comments in jrxml are erased by iReport post on http://community.jaspersoft.com

Problem

How to add comments in JasperReports template file (JRXML). I need to add some comments in each band to describe the functionality of band and also the need to write some comments for sub reports. So how do I add comments to jrxml file?

Original source