BIRT reporting Programming Tutorial for beginners

1- Introduction

This document is based on:
  • Eclipse 4.4 (LUNA) (ok for 4.5 Mars)
  • BIRT 4.4

2- Reporting interface after project completion

This is a photo of report will be made in this document:

Raw data:

First of all, we need to understand some professional knowledge:
  • A CUSTOMER can create one or more ACCOUNT in a branch of some bank.
  • Each account corresponds with a service PRODUCT provided by the bank.
  • Each account has an AVAILABLE BALANCE.
For convenience, you can look at the following raw data.
Select Acc.Account_Id
     ,Acc.Cust_Id 
     ,Cus.Address        Cust_Address 
     ,Acc.Product_Cd -- Product Code (Service of Bank)
     ,Acc.Open_Branch_Id -- Branch (of Bank)
     ,Bra.Name           Branch_Name
     ,Acc.Avail_Balance -- Available Balance
From   Account  Acc
     ,Customer Cus
     ,Branch   Bra
Where  Acc.Cust_Id = Cus.Cust_Id
And    Acc.Open_Branch_Id = Bra.Branch_Id;

3- The installation requires

BIRT Plugin:

For programming BIRT report, you need to install BIRT tools into Eclipse. You can see the instructions at:

Database LearningSQL

LearningSQL is a small database used commonly in the instruction of o7planning. The instruction of programming BIRT report also uses data on this Database. You need to create this Database (It takes only 5 minutes) as the following instruction:

JDBC Driver library of Database (OracleMySQLSQLServer) and its use:

Depending on the type of Database, you use the equivalent JDBC Driver library of that Database (It takes you 3 minutes to finish it), look at the instruction of download at:

4- Create BIRT Project

In Eclipse select: File/New/Other...
Enter Project name:
  • HelloBIRT

5- Create Data Source

Create a Data Source from JDBC, or XML,... In this document, we will create  Data Source from  JDBC connected with Database LearningSQL.
Here I connect JDBC with LearningSQL database (on DB Oracle). However, other Database manipulation is carried out alike.
ojdbc6.jar is a JDBC Driver library for Oracle
Depending on the type of Database, you use the equivalent JDBC Driver library of that Database, look at the instruction of download at:
Check whether database LearningSQL has been connected or not.

6- Create a Report

6.1- Create dataset

Enter:
  • Data Set Name: Account avail balance
Select Acc.Open_Branch_Id
     ,Bra.Name           Branch_Name
     ,Acc.Cust_Id
     ,Cus.Address        Cust_Address
     ,Acc.Account_Id
     ,Acc.Product_Cd
     ,Acc.Avail_Balance
From   Account  Acc
     ,Customer Cus
     ,Branch   Bra
Where  Acc.Cust_Id = Cus.Cust_Id
And    Acc.Open_Branch_Id = Bra.Branch_Id
Order  By Acc.Open_Branch_Id

6.2- Create new Report

In Eclipse select: File/New/Other...
File name:
  • BranchReport01.rptdesign

6.3- Configuring the size of the report

We create a default report whose size is the same as that of an A4 paper.
Select property:
  • Orientation: Landscape
Configuring Border:
You can also change other properties.

6.4- Interface Design (Header)

<H3>
Vietcombank
</H3>
<B>
<I>
For internal use only
</I>
</B>

6.5- Design charts

6.6- Run reports for the first time

6.7- Designing the body of the report

Raw data like the illustration below:
But we will design the report so that its display is more simple and eye-catching (As the below illustration)
We will carry out step by step.
Drag and drop Table icon into the screen of report.

6.8- Run report (2)

6.9- Edit style (1)

The report runs, but its interface is not beautiful. We need to adjust some styles.

6.10- Run report (3)

6.11- Sub Total

6.12- Run Report