Tweaking an existing report template

Open classicT.jrxml in iReport 3.5. I want to make a few look-and-feel changes to get a nicer template.

Reformat the title to use less space

Change the background color in all group labels to white (transparent) and the font color to black.

Change the default format for the date in the Page Footer. I want it to use Java’s MEDIUM format and to be appropriate for whatever locale the report is run in:
original: new Date()
modified: DateFormat.getDateInstance(DateFormat.MEDIUM, $P{REPORT_LOCALE}).format( new Date() )

Save the file as NeoClassicT.jrxml into the folder Templates somewhere on my harddrive. Also copy classicT.gif to NeoClassicT.gif.

The menu Tools -> Options opens the iReport options. The tab Wizard Templates allows me to add the folder “Templates”. I could add the jrxml file directly, but I prefer to add a folder so that additional templates will be picked up automatically.

Did it work?

Choose the menu File -> New… -> Report Wizard. Go through the wizard as usual, but on Step 7 I now see both the default template “Classic” and my new template “NeoClassicT”. Hooray.

If I were truly motivated I would modify NeoClassicT.gif to show a more accurate thumbnail of the template.

The file names are important. They must be “*T.jrxml” or “*C.jrxml”. iReport decides if they are columnar or tabular templates based on these names. Likewise, it matches up the thumbnail preview image based on name matching.

[…] you can get started customizing them for your own needs. You’ll find some tips in my article Creating Report Templates in iReport. Possibly related posts: (automatically generated)Report Templates in iReportcreate a Jasper Report […]