JFreeReport Usage


This code shows how to use JFreeReport to generate a PDF report from a ULCTable.

How to use

After starting the application, a window with a table is shown. After pressing the get report button a server side PDF file is generated and downloaded to the client.

How it is implemented

As JFreeReport takes a Swing table model to access the data, the adapter class SwingULCAdapterTableModel is used to map the ULC model to Swing. The Swing model is the actual data container. Then the code follows the example output direct to PDF of JFreeReport's manual to generate the report file on the server. Further the example uses the ResourceDownloadServlet and the helper classes of Etienne's com.canoo.template.util.download package. Please do not forget to configure this servlet in your application's web.xml.