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

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.

主站蜘蛛池模板: 万源市| 赤峰市| 奉贤区| 巧家县| 从江县| 绥江县| 南部县| 临朐县| 普陀区| 邢台市| 基隆市| 双流县| 汪清县| 安化县| 平谷区| 红安县| 镶黄旗| 茂名市| 都安| 高碑店市| 江安县| 台中市| 奉化市| 长葛市| 广宁县| 宾川县| 青海省| 曲周县| 黄大仙区| 固阳县| 水富县| 朝阳区| 康保县| 孟连| 横峰县| 兴和县| 于都县| 黄平县| 三都| 蚌埠市| 阳原县|