Windward Reports Servlet Example

This is a very basic example of how to use Windward Reports from a servlet. This example uses servlets only (no JSPs or EJBs) to give an example of a pure servlet implementation.

You are free to use this sample in any way you wish.

The first screen will ask you to select a report and data set. These reports and data sets are stored in the web.xml file. After you post this form, it will then display the final report.

Tutorials

To set this sample up:

Tomcat

Installation of Tomcat - (all links assume you are running on localhost)

  1. First install Java SE 1.6 JDK (first link, JDK 6 Update 16 with Java EE) from http://java.sun.com either the 32 or 64 bit version will work.
  2. Setup environment varialbes JRE_HOME (point this to the root location of your JRE installation) and JAVA_HOME (point this to the root installation of your Java installation)
  3. Download the ZIP file for Tomcat 5.5 and NOT THE WINDOWS INSTALLATION. The code in Tomct that runs the windows service does not work.
  4. Extract the ZIP file to a directory on your system, IE C:\tomcat.
  5. Startup Tomcat: Go to C:\tomcat\bin from a command prompt and run startup.bat
  6. Open a web browser and navigate to http://localhost:8080 . If you see the Tomcat webpage, congratulations you have successfully installed Apache Tomcat.
  7. If Tomcat is not running on your local computer, change "localhost" to the name of the remote computer's name.
  8. Shutdown Tomcat: Go to C:\tomcat\bin from a command prompt and run shutdown.bat
  9. Follow the directions below to setup the Windward Reports Java Servlet example.

The files

Setup Windward Java Servlet on Tomcat

  1. Copy this directory and all sub-directories to %TOMCAT_HOME%/webapps/WindwardReportsServlet.
  2. Copy your WindwardReports.properties file in the WEB-INF directory (the WindwardReports.properties file in this example does not have a legitimate license key).
  3. In the directory %TOMCAT_HOME%/webapps/WindwardReportsServlet/WEB-INF/lib place the following jar files:
      • commons-codec.jar
      • dom4j.jar
      • iText.jar (pdf reports only)
      • iTextAsian.jar (pdf reports in CJK only)
      • jaxen.jar
      • jcommon.jar
      • jfreechart.jar
      • poi.jar
      • WindwardReports.jar
      • Do not put log4j.jar in the lib directory. It must be copied to %TOMCAT_HOME%/common/lib!
  4. Check the version of all jar files in webapps/WindwardReportsServlet/WEB-INF/lib to make sure they match ther version in your Windward Reports Java Engine installation.
  5. Make sure you create the directory %TOMCAT_HOME%/webapps/WindwardReportsServlet/images NOTE: this will need to have write access for the web user on your system.
  6. Run build.bat in the WEB-INF/classes/com/windwardreports directory. NOTE: You will need to have javac.exe in your PATH or specify the full path location in build.bat
  7. Startup Tomcat: Go to C:\tomcat\bin from a command prompt and run startup.bat

Running this sample

Note: You need to install Tomcat, start Tomcat, build this example, and install this example in Tomcat before the following link will work.

  1. Once you have done all that go to http://localhost:8080/WindwardReportsServlet/ and you should see the servlet.
  2. Click here to go to the first screen

Copyright 2009 by Windward Studios, Inc. All Rights Reservered
Windward Reports