Ireport and jasperreport integrated Web report development wizard (1)

Source: Internet
Author: User

I contacted ireport and jasperreport a week ago. They didn't attract my interest (or trust) at the beginning of the download ), this is mainly because of their version issues (I have never dared to use tool software earlier than Version 1.0. Their current versions are ireport0.2.2 and jasperreport0.5.0), but I heard someone is using them, so I took a closer look (because I have always used a browser to print the Web Printing of Java applications, it is very painful, so I prefer to trust it, but it cannot trust it, huh, huh ......)

After a week, I tried to address some of the Report requirements in the project and found that they could all solve the problems. They were truly amazing, so I recommended them to you today. In fact, we only use jasperreport for reporting. ireport is a visual development tool of jasperreport. (Don't Look at its interface as it is a little simple. You can do whatever you want .), Of course, ireport has other functions, but I will not elaborate on it here. At present, there are almost no Chinese articles about their integrated development. Even so, I am not prepared to introduce them in detail. Here I only write some of my experiences, there are some places to try it out. If you want to study them carefully, please read their related English documents. Jasperreport documentation is very detailed, this document is charged, but there are circulating electronic versions on the Internet, I am lucky to get a copy, if you need to be able to my site (http://plateau.sicool.com) to get, I would like to thank jasperreport for its contribution to the open source world. On the contrary, there are not many ireport documents. Maybe the author thinks it is simple enough. I also have some development experience after numerous explorations.

Well, let's go into the process of integrated development reports between the two ......

1. First, you need to get their latest versions. You can download them at the address below.

Irport: http://ireport.sourceforge.net
Jasperreport: http://jasperreports.sourceforge.net

Their configuration is also very simple: After the ireport is decompressed, edit the ireport. BAT file in the directory, as shown below:

@ 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 easy? You only need to set the corresponding channels. Here ant is used for running. Of course, if ant is not installed and you do not want to install it, you can also, but here I am buying an official, you can find the corresponding running method in the decompressed directory. Install ant! Jasperreport does not require any configuration. You only need to put the downloaded jar package under classpath. Well, it's easy to say, but if we don't have ireport to do "dirty work" for us, what kind of pain would the report work be like ~!

2. How does jasperreport work?

Here I will talk about it in a simple way. First, you must have an XML file, and then compile it into a Jasper file. end of Jasper. jasper file, which is very familiar to us. JSP file, in fact, we call its compiled servlet.


(Picture from http://ireport.sourceforge.net/cap3.html#3.1)

However, static reports have no meaning, so there is a good saying: "A datasource + A Jasper = a print ". It supports the following output formats: PDF, HTML, XML, xls, CVS, and so on. Therefore, the original input of jasperreport is A. XML document. Imagine that there are hundreds of lines of XML files in a simple report. how painful it is to use it for reports before ireport is available. (What makes me incredible is that one of my classmates once used jasperreport for reporting, but they didn't actually use ireport, day !). Now you don't have to worry about it. You can use ireport to easily handle this XML. Here, I think of struts_config.xml, and there have been many visual editors about it.

If you want to prepare a report before ireport, it takes a long time to familiarize yourself with the jasperreport document. One purpose of this document is to compile the XML file, now you only need to familiarize yourself with ireport as long as he is familiar with the document.

3. Study on ireport

Let's take a look at this (rich and very simple to user GUI:

If you used to develop reports using VB or other development tools, you should be familiar with this interface at first glance. If it happens that you are familiar with the Java language, wow, so it should be easy for you to use irepor T.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.