- Download the latest GlassFish build from https://glassfish.dev.java.net/public/downloadsindex.html.
- See the Instructions to unbundle and configure GlassFish and the GlassFish Quick Start Guide to get GlassFish up and running.
- Make sure GlassFish is running by checking http://localhost:8080.
- Download JasperReports (jasperreports-1.2.0-project.zip) from http://sourceforge.net/project/showfiles.php?group_id=36382&package_id=28579.
- Unzip the downloaded JasperReports archive.
- Navigate to the the JasperReports demo webapp source directory.
- Run the ant command and specify the war target.
When the build is finished the jasper-webapp.war should be in the \webapp directory.
- Copy jasper-webapp.war to GlassFish install-dir/domains/domain1/autodeploy. The JasperReports demo webapp will be deployed automatically.
- Goto the JasperReports demo webapp running on http://localhost:8080/jasper-webapp/. If you get a 404 wait a couple of seconds and refresh; probably the application was not yet deployed. Eventually you should see the JasperReports Web Application Sample.
- In the leftside menu click the compile link and compile the report template either using the JSP or Servlet Example.
- Now the report template is compiled you can execute the report itself with the PDF and HTML output links in the leftside menu. Both PDF and HTML output should work!
In a next entry I will explain how to use Java Persistence API EJBQL queries directly in report templates. This by using the new JasperReports 1.2.0 extendible JRQueryExectureFactory feature.