Free tutorials for Java, Eclipse and Web programming



Follow me on twitter

Reporting with Eclipse BIRT and Java Objects (POJO's) - Tutorial

Lars Vogel Hendrik Still

Version 1.0

22.01.2010

Revision History
Revision 0.1 - 0.207.03.2008 Hendrik Still, Lars Vogel
Created Article
Revision 0.3 - 1.107.03.2009 - 30.08.2010Lars Vogel
bug fixes and enhancements

Eclipse Birt

This article describes how to use Eclipse BIRT for reporting on simple Java Objects (POJO's - Plan old Java Objects).

The article will also explain how to deploy the resulting BIRT report into a webcontainer (tomcat) and how to use it in an Eclipse RCP application.

Eclipse 3.5 (Eclipse Galileo) is used for this tutorial.


Table of Contents

1. Eclipse BIRT
1.1. Overview
1.2. Example
2. Installation
3. Project
4. Java classes
4.1. Overview
4.2. Domain Model
4.3. Data Access Object - Mock
5. Datasource and Dataset
5.1. The Datasource
5.2. The Dataset
5.3. JavaScript
6. Display the data in a table
6.1. Overview
6.2. Create a table
7. Chart
7.1. Create a Chart
8. Deploying in Tomcat
8.1. Overview
8.2. Install BIRT in Tomcat
8.3. Install your BIRT reports in Tomcat
9. Deploying in Eclipse RCP application
9.1. BIRT deploying to an RCP Application
10. Thank you
11. Questions and Discussion
12. Links and Literature
12.1. Source Code
12.2. Eclipse BIRT resources
12.3. vogella Resources

1. Eclipse BIRT

1.1. Overview

Eclipse BIRT allows the creation of reports using various data sources.

These data sources define where the data is stored. Data sets defines the query for the report.

BIRT provides for example the following data sources:

  • Databases (via JDBC)

  • Text Files (cvs, XML)

  • WebServices (via WSDL-Files)

  • Scripting Data sources

In a Java program it is often convenient to use directly Java objects as a data source for reports. This article will focus on the usage of plain old Java objects (POJO) as data sources for BIRT reports.

1.2. Example

In this tutorial we will build a report which will show us information about the stock market. We get the information from a Java Object. The data will be displayed in a chart and in a table with detailed information. The result should look like this: