Skip to Content

Printing Web Dynpro Java (WDJ) applications is one of the missing functionalities that everyone wants to have in their application. I have used third party open source reporting tool, JasperReports, to solve this issue. I would like to share how we have achieved this so other can get benefits from it. It also provides an alternative to read/print only Adobe Interactive forms.

 

Complexity of the solution doesn’t allow me to abridge the discussion, especially for those who haven’t worked on Jasper Reports before. Based on the scope, I have break down this topic into Three parts:

 

Part I: In Part-I we will be discussing; what JasperReports is and how to use it?

 

Part-II: Print Web Dynpro Java applications using JasperReports

Part-III: Print Web Dynpro Java applications using JasperReports

Part-III: Print Web Dynpro Java applications using JasperReports

 

Now let’s start our discussion on JasperReports.

 

Introduction:

JasperReports was started by Teodor Danciu, in 2001, to provide reporting capabilities to the project he was working on. Later that project got canceled; but he continued working on JasperReports in his spare time. Since its first release back in November 2001, JasperReports has become immensely popular, and is currently one of the most popular Java reporting tools available.

 

The JasperReports library is a very powerful and flexible report-generating tool that delivers rich content to the screen, printer, or file in PDF, HTML, RTF, XLS, ODT, CSV, or XML format. The library is written entirely in Java and can be used in a variety of Java-enabled applications, including J2EE or web applications, to generate dynamic content. Its main purpose is to help to create page-oriented, ready-to-print documents in a simple and flexible manner.

 

How Jasper Report works:

JasperReports, like most reporting applications, uses report templates structured in multiple sections, such as title, summary, detail, and page and group headers and footers. Each section has a free-form layout in which you can place various types of elements, including images, static and dynamic text fields, lines, and rectangles. The reporting engine uses this template to organize data in an XML file (JRXML) or to create it programmatically using the library’s API. This data may come from various data sources, including relational databases, collections, or arrays of Java objects or XML data. Users can plug the reporting library into custom-made data sources by implementing a simple interface. A typical workflow while creating reports with JasperReports:

 

JasperReports Process Flow

What you need:

JasperReports can be downloaded from http://www.sourceforge.net/projects/jasperreports.  As Jasper Reports are java based so you need JDK version as required by the version of Jasper Reports. Other Dependencies are listed below:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dependency

 

 

Download URL

 

 

Comments

 

 

Commons Logging

 

 

http://jakarta.apache.org/commons/logging/

 

 

 

 

Used for sending output to a log.

 

 

Commons Collections

 

 

http://jakarta.apache.org/commons/collections/

 

 

 

 

Used to manage collections of data.

 

 

Commons BeanUtils

 

 

http://jakarta.apache.org/commons/beanutils/

 

 

 

 

Used for JavaBeans introspection.

 

 

Commons Digester

 

 

http://jakarta.apache.org/commons/digester/

 

 

 

 

Used for XML parsing.

 

 

JFreeChart

 

 

http://www.jfree.org/jfreechart/

 

 

 

 

Only required when the report contains charts.

 

 

iText

 

 

http://www.lowagie.com/iText/

 

 

 

 

Only required when exporting reports to PDF or RTF.

 

 

Jakarta   POI

 

 

http://jakarta.apache.org/poi/

 

 

 

 

Only required when exporting reports to Excel format.

 

 

JExcelApi

 

 

http://jexcelapi.sourceforge.net/

 

 

 

 

Only required when exporting reports to Excel format.

 

 

iReport is another open source project that provides graphical editor to design jasper reports. iReport can be downloaded from: http://sourceforge.net/projects/ireport.

 

Conclusion:

In this blog we reviewed what are jasper reports and how it works. In next tutorial of this series we will be developing some Java code that generate reports using Jasper Reports.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply