官术网_书友最值得收藏!

Downloading JasperReports

JasperReports is distributed as a JAR file that needs to be added to the CLASSPATH of any application we wish to add reporting capabilities to. JasperReports can be downloaded from http://jasperforge.org/plugins/project/project_home.php?group_id=102.

Downloading JasperReports

Clicking on the Download link around the center of the page will take us to the JasperReports download page on SourceForge.net.

Downloading JasperReports

The specific version on your screen might be different; at the time of writing, the latest stable version of JasperReports is 3.5.2.

It is not always clear what exactly is downloaded by clicking on these links; thus, we will provide a brief explanation of what each link is for.

  • jasperreports-3.5.2-applet.jar: This first download link is for a JAR file containing a subset of the JasperReports functionality. Specifically, it contains classes that can be used to display JasperPrint files, which are reports in JasperReports' native format. This file is offered as a separate download as a convenience for developers; it can be used for applications or applets that don't need full reporting capabilities, yet need to display generated reports. Even though the filename has a suffix of "applet", there is nothing preventing us from using it with standalone applications, without the overhead that the missing JasperReports classes would add to the download. This file is approximately 346 KB in size.
  • jasperreports-3.5.2.jar: This is the second download link, and it is the complete JasperReports class library. It contains all classes necessary to compile, fill, and export reports, but does not include any additional libraries that JasperReports depends on. This is the minimum file requirement for us to add full reporting capabilities to our Java applications. However, if we choose to download this file, we need to download the JasperReports dependencies separately. This file is approximately 2.2 MB in size.
  • jasperreports-3.5.2-javaflow.jar: This is the third download link, and it is the javaflow version of JasperReports. This version of JasperReports should be used in environments where multithreading is discouraged. This file is approximately 2.2 MB in size.
  • jasperreports-3.5.2-project.tar.gz: This is the fourth download link, and it contains the complete JasperReports class library plus all the required and optional libraries. In addition, it contains the entire file as a gzipped TAR file, which is common in Unix and Unix-like systems, such as Linux. This download also includes the JasperReports source code and a lot of source code providing examples of JasperReports' functionality. This gzipped TAR file is approximately 42 MB in size
  • jasperreports-3.5.2-project.zip: The fifth download link, like the fourth link, contains the complete JasperReports class library plus all the required and optional libraries, along with the JasperReports source code. However, it contains the files in ZIP format, which is more commonly used under Microsoft Windows. This file is approximately 51 MB in size.

    Tip

    Unless Internet connection speed is an issue, we recommend downloading one of the last two mentioned files, as they include everything we need to create reports with JasperReports. Another good reason to download one of these files is that the included examples are a great way to learn how to implement the different JasperReports features. All of the examples in the file come with an ANT build file containing targets to compile and execute them.

We will refer to this file as the JasperReports project file, or more succinctly, as the project file.

Once we have downloaded the appropriate file for our purposes, we need to set up our environment to be able to start creating reports. In the next section, we discuss how to do this, assuming that the project file was downloaded.

Setting up our environment

To set up our environment to get ready for creating reports, we need to extract the JasperReports project ZIP file to a location of our choice. Once we extract the project ZIP file, we should see a jasperreports-3.5.2 directory (The actual name of the directory may vary slightly depending on the version of JasperReports.) containing the following files and directories:

  • build: This directory contains the compiled JasperReports class files.
  • build.xml: This is an ANT build file, which builds the JasperReports source code. If we don't intend to modify JasperReports, we don't need to use this file as JasperReports is distributed in compiled form.
  • changes.txt: This file explains the differences between the current and previous versions of the JasperReports' class library.
  • demo: This directory contains various examples demonstrating several aspects of JasperReports functionality.
  • dist: This directory contains a JAR file containing the standard, javaflow, and applet versions of the JasperReports library. We should add one of these JAR files to our CLASSPATH to take advantage of JasperReports functionality.
  • docs: This directory contains a quick reference guide to most XML tags used in JasperReports templates.
  • lib: This directory contains all the libraries needed to build JasperReports and to use it in our applications.
  • license.txt: This file contains the full text of the LGPL license.
  • pom.xml: This is a Maven 2 POM file used to build JasperReports with Maven, just like build.xml. We don't need this file because JasperReports is distributed in compiled form.
  • readme.txt: This file contains instructions on how to build and execute the supplied examples.
  • src: This directory contains the JasperReports source code.

    Tip

    Getting up and running quickly

    To get up and run quickly, the files to add to the CLASSPATH are the JasperReports JAR files, and all the JAR files under the lib directory in the project ZIP file. By adding these files to the CLASSPATH, we don't have to worry about the CLASSPATH when implementing additional functionality, for example, when exporting to PDF or producing charts.

主站蜘蛛池模板: 涿州市| 淄博市| 长寿区| 土默特左旗| 康定县| 长垣县| 泗阳县| 达拉特旗| 漳州市| 香河县| 瑞丽市| 兰考县| 尼勒克县| 昆明市| 闽清县| 靖远县| 揭东县| 德州市| 房产| 石嘴山市| 崇义县| 顺平县| 蓬莱市| 民和| 鄂温| 夏津县| 策勒县| 吉隆县| 巴林右旗| 申扎县| 台中市| 金坛市| 扎鲁特旗| 黑山县| 玉环县| 噶尔县| 宁夏| 商丘市| 保山市| 斗六市| 尚义县|