I have been in contact with Ireport and Jasperreport a week. Downloading at the beginning they didn't attract my interest (or trust), mainly their version of the problem (I have never dare to use the version of the tool software that is less than 1.0, currently Version: Ireport0.2.2, JasperReport0.5.0), but I heard that someone is using them, so I have read it carefully (because I have always used browser printing in Java applications, very painful, so I would rather Letter it is not credible, huh, huh ...)
A week, I tried some demand points about the report on the project, I found that they can solve it, really happy, so I recommend them to you today. In fact, we are just JasperReport, Ireport is a visual development tool for JasperReport (do not look at its interface, we have to do it to help us get easy.), Of course Ireport has other use, but here Not elaborate. There is almost no Chinese introduction to the introduction of their integration development, although I don't prepare for very detailed introduction, I only write some experience, there is no shortage to taste, if you want to study them, please also ask them. Read their supporting English documents. JasperReport's supporting document is very detailed. This document is charged, but there is a circulating electronic version on the Internet. I am fortunate to get a copy. If you need to get it to my site (http://plateau.sicool.com), thank you JasperReport's contribution to the open source world. Instead, IREPORT has not much document, perhaps the author thinks it is simple enough, I am also an experienced experience in countless exploration.
Ok, let us enter the journey of the above three to integrate reports ...
1. First you have to get the latest version, you can download the address below
Irport: http://ireport.sourceforge.net JasperReport: http://jasperreports.sourceforge.net
Their configuration is also very simple: Ireport decompresses the Ireport.bat file in the editing directory after the decompression, as follows
@echo off
Set java_home = c: / jdk14
SET ANT_HOME = D: / Ant
SET IREPORT_HOME = C: / Documenti / Progetti / Ireport / IREPORT2 /
REM% ANT_HOME% / BIN / ANT JAVADOCS
% Ant_Home% / Bin / Ant Ireport
Is it very simple, you only need to set some of the corresponding roads, here is Ant to run, of course, if you don't have an Ant, you don't want to install it, then you can, but here I bought an official, you can go Find the corresponding operating method in the directory after decompression. Oh, install Ant! JasperReport does not need any configuration, you only need to put the jar package after downloading to ClassPath. Oh, it is simple, but if there is no Ireport to do "dirty" for us, what will be the pain of the report?!
2. How is JasperReport work?
Here I will say it simply. First, there is an XML file first, then compile into a Jasper file (end of .jasper), we really want to use .jasper files after compilation, this is much like we are familiar with .jsp file, in fact, we call it compilation Subsequent servlet. (Image from http://ireport.sourceforge.net/cap3.html# 3.1)
However, the static report does not mean, so there is a saying: "A Datasource a Jasper = a print". It can support the output format as follows: PDF, HTML, XML, XLS, CVS, etc. Therefore, JasperReport's original input is a .xml document, imagine that there is a simple report to the XML file, which is there, how painful before Ireport is used. (I am incredible is that I have used JasperReport to do reports with JasperReport, but they have not used Ireport, day!). Now don't be afraid, use Ireport to easily get this XML, write here, I think of struts_config.xml, and there is a lot of editors about it, huh, huh.
If you want to do a report, if you want to do a report, you have to spend a long time to familiarize with JasperReport's document, and one of the familiar documents is to write that XML file, now you are familiar with the time you are familiar with IREPORT.
3. Ireport
Let's take a look at this (Rich and Very Simple to User GUI):
If you have had experience in developing reports in VB or other development tools, this interface should be familiar, if you happen, you are familiar with Java language, wow, then you should use Irepor T to be easy, huh,