Installing iReport and adding JasperReports to your netbeans

You may use your different IDEs, but since I am using netbeans for my current project, I will share you how to use iReport with your netbeans.

For iReports, as I mentioned in the previous post, you can use the standalone app as well as the plugin for netbeans. In installing iReports and jasperReports, you need to be careful with the version of each library. In my case, I uses the plugin instead of standalone version. iReport version is 5.5.0 and JasperReports is version 6.0.0. To be able to use, I added a few libraries like this.

Capture

For iReport, go to netbeans’ Tool > Plugin > Downloaded > Add plugins and add the downloaded plugin files.

I had problems while installing because of the versions of libraries and jdk. So be careful with it and Have fun!

JasperReport LifeCycle

Let’s learn about the life cycle of a report.

When you design using iReport, it is creating JRXML file, which is a XML file that contains about definitions of the structure of the report. In this stage, it is designing pure visual, so you don’t need to care about the real structure of XML file.

After designing, the XML file is needed to be compiled before executing a report. When compiled, a binary object, .jasper file, is generated from .jrxml file.

When the compilation is done, a report can be executed to designated file format. During execution, .jasper file together with a data source is passed to JasperReports to generate a required report.

JasperReports is flexible for types of data sources. The data source can be SQL Query, XML file, csv file, HQL query or collection of javabeans. You can even write your own customized data source to link to JasperReports.

Along the report generating process, iReport will include in JRXML designing, Jasper compiling, Report executing, Document exporting and Visualizing.

JasperReport Getting Started

I just started learning how to use JasperReports and I think this is one of the best ideas to share what I learnt.

What is Jasper Report?
Jasper Reportsis an open source Java reporting tool that can generate dynamic content for a variety of targets, such as: screen, a printer, into PDF, HTML, Microsoft Excel, RTF, ODT, Comma-separated values or XML files.

It cannot run on its own and must be embedded in another client- or server-side Java application.

What is iReport?
iReport is an OpenSource program that can create complex reports which can use every kind of java application through JasperReports library. It is written in 100% pure java and it is distributed with its source codes according to the GNU General Public License. It is a visual tool to obtain XML files for JasperReports. It provides a WYSIWYG environment to design reports.

iReports is the Visual Report Designer for JasperReports library, which is the open source Java reporting library. You can also use JasperReports Server instead of JasperReports if you don’t want to create custom application for reports. JasperReports is easy to integrate with Java application.

JasperServer provides a web based interface to manage, schedule, and run the reports; a repository to store all the report resources like images, fonts, data sources and much more; a security service to decide who can execute which report; and a web services API to execute the reports from external applications (so you can generate reports from any kind of environment, like PHP or .NET).

In the big picture, iReport Designer allows you to design reports, JasperReports allows to execute them and generate output in a Java application, and JasperServer allows both end users and external applications to access, view, and publish your reports securely. JasperServer also makes reports interactive by adding drill down and drill up capabilities to your documents.

You can use iReport in two different ways-
a. Standalone installation
b. Using Plugins

This is all for now. If you have any question, please leave comment. To get further update, please follow this blog.