Before we start on the how to section of this article I wanted to welcome a new member of our team. We have an intern working with us in the BRMS team that I would like to introduce, Kumar Bijyendra. What better way to introduce him than to present some of his work, so without further delay, here is the guide to get you started adding on JasperReports for JBoss BRMS 5.3.
Introduction
Jasperreports is a free downloadable library that can be used for generating rich reports for Java EE applications. This guide also provides the steps to generate report templates using Jasper iReport designer.
Software requirements
- JBoss BRMS 5.3 (from customer portal, http://access.redhat.com)
- JasperReports 4.6.0
- Jasper iReports
- Maven (for building report server)
- Ant (for building JasperReports)
Adding on JasperReports
Just follow these steps to get it up and running.
- install JBoss BRMS 5.3 standalone.
- create the following directories in in BRMS install
- $JBOSS_HOME/server/default/data/Jasper
- $JBOSS_HOME/server/default/data/Jasper/Output
- Download (latest) Jasperreports 4.6.0 from the following location
- Extract the contents of the downloaded folder in a local directory.
- Goto jasperreports-4.6.0-project\jasperreports-4.6.0 directory where the build.xml file resides and do an ant build. This will create the distribution jars at the following location $path_to_jasper\jasperreports-4.6.0-project\jasperreports-4.6.0\dist
-
Jasperreports-applet-4.6.0
-
Jasperreports 4.6.0.jar
-
Jasperreports-fonts-4.6.0
-
Jasperreports-javaflow-4.6.0
-
- Copy the above jars to the following location
- $JBOSS_HOME\server\default\deploy\gwt-console-server.war\WEB-INF\lib
- Get report server code from github repository from the following location
- Go to the root directory of the downloaded code and do a maven build: mvn clean install. This will generate the distribution jars; reports-core-1.3.0.jar, report-shared-1.3.0.jar
- Copy the two previous jar folders from the dist directory to the $JBOSS_HOME\server\default\deploy\gwt-console-server.war\WEB-INF\lib
- Delete the existing reports-core-final-1.4.0 and reports-shared-final-1.4.0 in the $JBOSS_HOME\server\default\deploy\gwt-console-server.war\WEB-INF\lib
- Download jasper report templates overall_activity.jasper and overall_activity.jrxml from the following link and copy into $JBOSS_HOME/server/default/data/Jasper
- Copy the following library jars from $path_to_jasper\jasperreports-4.6.0-project\jasperreports-4.6.0\lib to the following location $JBOSS_HOME\server\default\deploy\gwt-console- server.war\WEB-INF\lib
- commons-digester-2.1
- jfreechart-1.0.12
- jcommon-1.0.15
Customization and editing .jrxml file
- Follow the document JasperReports-Ultimate-Guide-3.0 in docs folder at $path_to_jasper/jasperreports-4.6.0-project\jasperreports-4.6.0\docs
- Download and install Jasper iReports designer from the following location
- Open the overall_activity.jrxml file in the iReports and edit. Save the .jrxml file and compile by clicking on the preview tab. Copy both the .jrxml (only for future reference) and .jasper file to the $JBOSS_HOME/server/default/data/Jasper
Enjoy and don’t forget to ping Kumar Bijyendra with a big thank you!
