Right Outer Join

16 April 2009

Finding Report Templates in iReport

Filed under: iReport — Tags: , , — mdahlman @ 10:13

Where are iReport’s report Templates?

The article has been deprecated. Don’t read it. You should refer to Finding Report Templates in iReport 3.7 instead. But I’m leaving this one up just in case you’re stuck using iReport 3.1 for some odd reason. The points made below are still true… they just are very relevant anymore.

iReport uses report templates to enable a designer to develop new reports quickly. iReport ships with two prebuilt templates, and you’re free to add more templates yourself. Your self-built templates will include appropriate fonts, color schemes, logos, etc.

It’s great that there are some sample templates to get you started, but Jaspersoft ought to include more sample templates with iReport. Rather than just complain about it… I’ll take a look at what’s involved in creating new templates.

First I need to find the existing templates. This is harder than you might expect. The templates were shipped as standalone .jrxml files back in the days of iReport Classic (versions 3.0 and earlier). But beginning with iReport 3.1 the .jrxml files are embedded directly into the iReport .jar files. iReport is now based on the NetBeans platform, so there are a lot of NetBeans related jars in a lot of directories, and none of it is familiar to me. Where are the iReport-specific files? I found them here:
<iReport dir>/ireport/modules

But where are the .jrxml template files? Browsing through a .jar file isn’t always easy. My tool of choice to find files inside it quickly is 7zip. It has an nicely unobtrusive GUI interface, but it’s the command line that I needed here:

7z l -r com-jaspersoft-ireport.jar *.jrxml
7-Zip 4.42  Copyright (c) 1999-2006 Igor Pavlov  2006-05-14
Listing archive: com-jaspersoft-ireport.jar
   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------
2009-03-27 01:03:08 .....          750          750  com/jaspersoft/ireport/Jrxml/Template.jrxml
2009-03-27 01:03:08 .....          768          768  com/jaspersoft/ireport/Jrxml/Template_groovy.jrxml
2009-03-27 01:03:08 .....         1803         1803  com/jaspersoft/ireport/designer/resources/style.jrxml
2009-03-27 01:03:08 .....         7380         7380  com/jaspersoft/ireport/designer/templates/classicC.jrxml
2009-03-27 01:03:08 .....         7454         7454  com/jaspersoft/ireport/designer/templates/classicT.jrxml
2009-03-27 01:03:08 .....          750          750  com/jaspersoft/ireport/newReport.jrxml
------------------- ----- ------------ ------------  ------------
                                 18905        18905  6 files

The interesting file in this case is classicT.jrxml. This is the prebuilt template with a tabular layout. I find it much more useful than classicC.jrxml, so I’ll base my new template on classicT.jrxml. First extract the file from the .jar. Then open it in iReport. (While I’m at it, I also extracted classicT.gif. You’ll see why later.)

At this point I have successfully found the report templates that I want. Next episode: creating new templates.

Advertisements

4 Comments »

  1. […] Finding Report Templates in iReport « Blog Archive « Right Outer Join (tags: jasperreports, template) […]

    Pingback by links for 2009-04-30 | kerstins kleiner blog — 30 April 2009 @ 21:06

  2. good job.. very handy advice. I have been trying to look for the best way to standardize report format throughout.

    Comment by V T — 30 August 2009 @ 18:45

  3. This was very useful and helpful, thank you!

    Comment by Gant — 3 March 2010 @ 10:03

  4. […] article supersedes my article from a year ago about finding templates in iReport. I’m leaving the old article up because it’s useful if you’re still using iReport […]

    Pingback by Finding Report Templates in iReport 3.7 « Right Outer Join — 2 April 2010 @ 15:34


RSS feed for comments on this post. TrackBack URI

Go on... leave a reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: