Thursday, April 6, 2006



I've just successfully deployed the demo webapp of JasperReports - The most popular open source reporting engine in the world - on the latest GlassFish build (b42).

  1. Download the latest GlassFish build from https://glassfish.dev.java.net/public/downloadsindex.html.
  2. See the Instructions to unbundle and configure GlassFish and the GlassFish Quick Start Guide to get GlassFish up and running.
  3. Make sure GlassFish is running by checking http://localhost:8080.
  4. Download JasperReports (jasperreports-1.2.0-project.zip) from http://sourceforge.net/project/showfiles.php?group_id=36382&package_id=28579.
  5. Unzip the downloaded JasperReports archive.
  6. Navigate to the the JasperReports demo webapp source directory.
    cd jasperreports-1.2.0\demo\samples\webapp
  7. Run the ant command and specify the war target.
    ant war
    When the build is finished the jasper-webapp.war should be in the \webapp directory.
  8. Copy jasper-webapp.war to GlassFish install-dir/domains/domain1/autodeploy. The JasperReports demo webapp will be deployed automatically.
  9. 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.
  10. In the leftside menu click the compile link and compile the report template either using the JSP or Servlet Example.
  11. 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.

1 comment:

Anup said...

it was really useful...thanks a million....i will keep looking for next .....