[go: up one dir, main page]

0% found this document useful (0 votes)
39 views53 pages

BIRT Reporting Programming Tutorial For Beginners

BIRT Reporting Programming Tutorial for Beginners

Uploaded by

ahosainy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views53 pages

BIRT Reporting Programming Tutorial For Beginners

BIRT Reporting Programming Tutorial for Beginners

Uploaded by

ahosainy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

11/18/2015 BIRT reporting Programming Tutorial for beginners

o7planning

BIRT reporting Programming Tutorial for beginners

1- Introduction
2- Reporting interface after project completion
3- The installation requires
4- Create BIRT Project
5- Create Data Source
6- Create a Report

6.1- Create dataset


6.2- Create new Report
6.3- Configuring the size of the report
6.4- Interface Design (Header)
6.5- Design charts
6.6- Run reports for the first time
6.7- Designing the body of the report
6.8- Run report (2)
6.9- Edit style (1)
6.10- Run report (3)
6.11- Sub Total
6.12- Run Report

1- Introduction ▴
This document is based on:

Eclipse 4.4 (LUNA)

BIRT 4.4

2- Reporting interface after project completion ▴


This is a photo of report will be made in this document:
http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 1/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

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.

1 Select Acc.Account_Id ?
2 ,Acc.Cust_Id
3 ,Cus.Address Cust_Address
4 ,Acc.Product_Cd -- Product Code (Service of Bank)
5 ,Acc.Open_Branch_Id -- Branch (of Bank)
6 ,Bra.Name Branch_Name
7 ,Acc.Avail_Balance -- Available Balance
8 From Account Acc
9 ,Customer Cus
10 ,Branch Bra
11 Where Acc.Cust_Id = Cus.Cust_Id
12 And Acc.Open_Branch_Id = Bra.Branch_Id;

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 2/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

3- The installation requires ▴

BIRT Plugin:

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

http://o7planning.org/web/fe/default/en/document/18651/install-birt-report-tools-into-eclipse

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:
LearningSQL (Example Database For Oracle)

http://o7planning.org/web/fe/default/en/document/20836/database-to-learn-sql-learningsql-oracle

LearningSQL (Example Database For SQLServer)

http://o7planning.org/web/fe/default/en/document/20852/database-to-learn-sql-learningsql-sqlserver

LearningSQL (Example Database For MySQL)

http://o7planning.org/web/fe/default/en/document/20844/database-to-learn-sql-learningsql-mysql

JDBC Driver library of Database (Oracle, MySQL, SQLServer) 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:

http://o7planning.org/web/fe/default/en/document/21135/jdbc-driver-libraries-for-different-types-of-database-
in-java

4- Create BIRT Project ▴


http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 3/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

In Eclipse select: File/New/Other...

Enter Project name:

HelloBIRT

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 4/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

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.

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 5/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

Here I connect JDBC with LearningSQL database (on DB Oracle). However, other Database manipulation is carried
out alike.

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 6/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

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:

http://o7planning.org/web/fe/default/en/document/21135/jdbc-driver-libraries-for-different-types-of-
database-in-java

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 7/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

Check whether database LearningSQL has been connected or not.

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 8/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 9/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

6- Create a Report ▴
6.1- Create dataset ▴

Enter:

Data Set Name: Account avail balance

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 10/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

1 Select Acc.Open_Branch_Id ?
2 ,Bra.Name Branch_Name
3 ,Acc.Cust_Id
4 ,Cus.Address Cust_Address
5 ,Acc.Account_Id
6 ,Acc.Product_Cd
7 ,Acc.Avail_Balance
8 From Account Acc
9 ,Customer Cus
10 ,Branch Bra
11 Where Acc.Cust_Id = Cus.Cust_Id
12 And Acc.Open_Branch_Id = Bra.Branch_Id
13 Order By Acc.Open_Branch_Id

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 11/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 12/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 13/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

6.2- Create new Report ▴


In Eclipse select: File/New/Other...

File name:

BranchReport01.rptdesign
http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 14/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 15/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

6.3- Configuring the size of the report ▴


We create a default report whose size is the same as that of an A4 paper.

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 16/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

Select property:

Orientation: Landscape

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 17/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

Configuring Border:

You can also change other properties.

6.4- Interface Design (Header) ▴

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 18/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 19/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 20/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

1 <H3> ?
2 Vietcombank
3 </H3>

1 <B> ?
2 <I>
3 For internal use only
4 </I>
5 </B>

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 21/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

6.5- Design charts ▴

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 22/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 23/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 24/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 25/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 26/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 27/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 28/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 29/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 30/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

6.6- Run reports for the first time ▴

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 31/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

6.7- Designing the body of the report ▴


Raw data like the illustration below:

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 32/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

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.

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 33/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 34/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 35/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 36/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 37/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 38/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 39/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 40/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

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.

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 41/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 42/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 43/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 44/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

6.10- Run report (3) ▴

6.11- Sub Total ▴

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 45/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 46/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 47/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 48/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

6.12- Run Report ▴

Related Document Categories

Report Programming

Java Basic

What is needed to get started with Java?

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 49/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

Guide to Installing and Configuring Java


Guide to Installing and Configuring Eclipse
Quick Learning Java for beginners
JDK Javadoc in CHM format
Inheritance and polymorphism in Java
Access modifiers in Java
Java Enum Tutorial
Java Annotation Tutorial
Comparison and sorting in Java
Java String, StringBuffer and StringBuilder Tutorial
Java Exception Handling Tutorial
Java Generics Tutorial
Java Collection Framework Tutorial
Java IO Tutorial - Binary Streams
Java IO Tutorial - Character Streams
Java Date Time Tutorial
Syntax and new features in Java 8
Java Regular expression Tutorial
Java Multithreading Programming Tutorial
JDBC Driver Libraries for different types of database in Java
Java JDBC tutorial
Java Compression Tutorial
Java reflection Tutorial
Java remote method invocation - Java RMI Tutorial
Java Socket Programming Tutorial
Java Desktop Application Programming using SWT
Eclipse JFace Tutorial
Commons IO Tutorial
Commons Logging Tutorial

Advanced Java

Java Programming for team using Eclipse and SVN


Customize java compiler processing your Annotation (Annotation Processing Tool)
Java Aspect Oriented Programming Tutorial with AspectJ (AOP)
Install Maven into Eclipse
Maven Tutorial for Beginners
Maven Manage Dependencies

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 50/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

Setup a Multiple Module Project using Maven


Install JBoss Tools into Eclipse
Java Hibernate Tutorial for Beginners
Using Hibernate Tools generate entity classes from Tables

Server-side Programming

Configuring Tomcat Server in Eclipse


Guide to installing and configuring Glassfish Web Server
Java Servlet Tutorial for Beginners
Java Servlet Filter Tutorial
Java JSP Tutorial for Beginners
Install Web Tools Platform into Eclipse
Create a Simple Web Application Using Servlet, JSP and JDBC
Using Google reCAPTCHA with Java Web Application
Run Maven Web Application in Tomcat Maven Plugin
Run Maven Web Application in Jetty Maven Plugin
Struts2 Tutorial for Beginners
Spring MVC Tutorial for Beginners - Hello Spring 4 MVC
Simple Login Web Application using Spring MVC, Spring Security and Spring JDBC
Spring MVC and Hibernate Transaction Tutorial

Struts2 Framework

Struts2 Tutorial for Beginners


Struts2 Tutorial for Beginners (Annotation Configuration)

Spring Framework

Spring Tutorial for Beginners


Spring MVC Tutorial for Beginners - Hello Spring 4 MVC
Install Spring Tool Suite into Eclipse
Configuring Static Resource and Resource Bundle in Spring MVC Tutorial
Spring MVC File Upload Tutorial
Spring JDBC Tutorial

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 51/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

Simple Login Web Application using Spring MVC, Spring Security and Spring JDBC
Spring MVC and Velocity Tutorial
Using Template in Spring MVC with Apache Tiles
Spring MVC and Spring JDBC Transaction Tutorial
Spring MVC and Hibernate Transaction Tutorial

Eclipse Technology

Install AspectJ development tools into Eclipse


Java Aspect Oriented Programming Tutorial with AspectJ (AOP)
How to get the open source Java libraries as OSGi(s)
Install Tycho into Eclipse
Java OSGi Tutorial for Beginners
OSGi and AspectJ integration
Building OSGi project with Maven and tycho
Install WindowBuilder into Eclipse
Java Desktop Application Programming using SWT
Eclipse JFace Tutorial
Install e4 Tools Developer Resources into Eclipse
Eclipse RCP 4 Tutorial for Beginners - E4 Workbench Application
Guide to Packing and Deploying Desktop Application SWT/RCP
Install RAP tools into Eclipse
Install RAP e4 Tooling into Eclipse
Install Eclipse RAP Target Platform
Eclipse RAP Tutorial for Beginners - Basic Application
Eclipse RAP Tutorial for Beginners - e4 Workbench Application
Create Eclipse RAP Widget from ClientScripting-based widget
Guide to packaging and deploying Eclipse RAP application
Install GEF into Eclipse
Eclipse RAP Tutorial for Beginners - Workbench Application (Earlier e4)
Eclipse RCP 3 Tutorial for Beginners - Workbench Application
Simple Eclipse RCP 3 Application - View and Editor integration

Java API for HTML & XML

Parsing an XML File Using SAX


JDOM2 Tutorial
http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 52/53
11/18/2015 BIRT reporting Programming Tutorial for beginners

JAXB Tutorial
Jsoup Java Html Parser Tutorial

Java Open source libraries

Skype Java API Tutorial


Using Scribe OAuth Java API with Google OAuth 2 Tutorial
JDOM2 Tutorial
Jsoup Java Html Parser Tutorial

Newest Documents

Configuring Android Simulator on Android Studio


Android Tutorial for Beginners - Hello Android
Maven Manage Dependencies
Oracle APEX Tutorial, Tabular Form
What is needed to get started with Android?
Guide to Installing and Configuring Android Studio
Java Generics Tutorial
Using Template in Spring MVC with Apache Tiles
Jsoup Java Html Parser Tutorial
Using Google reCAPTCHA with Java Web Application

o7planning.org

http://o7planning.org/web/fe/default/en/document/24462/birt-reporting-programming-tutorial-for-beginners 53/53

You might also like