JasperReports Official Website Source Demo how to see

Source: Internet
Author: User

[GuideFirst you need to install ant, and note that you should not forget to set path in path, for example, if the ant installed in my system is D:\apache-ant-1.6.2, then set the environment variable in path. Next is download Jasperreport, download that with demo, will he decompression, so early work completed.  Open \jasperreport\demo Amples, here is the official offer of all the examples: 1. Alterdesi
First you need to install ant, and note that you should not forget to set path in path, for example, if the ant installed in my system is D:\apache-ant-1.6.2, then set the environment variable in path. Next is download Jasperreport, download that with demo, will he decompression, so early work completed.

Open \jasperreport\demo Amples, here is the official offer of all the examples:

1. Alterdesign

Using Ant to run this example shows the overall workflow of Jasperreport, while showing how PDF files are generated, background color control, and so on. First of all, to understand how Jasperreport works, it is based on XML files, (used ireport know, it is used to generate this XML file), so under Alterdesign, We just need to keep Alterdesignapp.java (this is the Java source file, needless to say); Build.xml This is what ant needs to use, about how the file is written, I think should not rote, if you want to use, find a template copy on the line, or look at the HTTP ://dev.csdn.net/develop/article/65/65567.shtm know a probably on the line; Alterdesignreport.jrxml, this is the XML file that we just said, this is also necessary. We can delete the rest of the documents (note that alterdesign), that is to say, our example wins 3 files. Now that you're using ant, go to the directory at the command prompt, and start by typing the ant javac. You don't need me to say, compile this Java file, now you have a. class; the second step is to use the ant compile, which is actually called compiling, It's the Jasperreport engine that compiles that XML file, generates something that's counter polish, which we don't care about, as long as we see a alterdesignreport.jasper build. The third step is to type ant fill, as the name suggests, the fill of the report, Generated Alterdesignreport.jrprint last step ant pdf or ant view or ant print, the previous one is to generate a PDF file, the middle one is in swing form preview, the latter is to call the print interface. Well, the whole workflow is clear. Now we can see the Alterdesignapp.java, really at a glance.

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.