A.2. Installing

Installing report samples involves the creation of a Java Project. To create the project follow these steps:

Procedure A.1. Installing report samples

  1. Unzip the downloaded archive.

    For convenience we will consider that the installation is performed on a Windows machine and that the archive is extracted on drive C. Ensure the correct extraction by confirming the presence of the following directories:

    c:\jasperreports
    c:\jasperreports\demo
  2. Open the Java Project wizard.

    In Eclipse, open the new project creation wizard by selecting: File->New->Project.... Select the Java Project option and proceed to the next step.

  3. Choose the project name and location

    Choose the name samples for the project. Select the directory c:\jasperreports\demo as the external location of the project and then proceed to the next step.

    Figure A.1. Java Project name and location

    Java Project name and location
  4. Configure build settings

    The wizard automatically detects and proposes correct source folders as shown below:

    Figure A.2. Source Folders

    Source Folders

    Select the Libraries tab and configure the classpath as follows.

    • Click the Add JARs... button and add the barbecue, jCharts, jcommon and jfreechart jar files.

    • Click the Add External JARs... button and add the following jar files:

      c:\jasperreports\lib\itext-1.01.jar
      c:\jasperreports\lib\servlet.jar
    • Click the Add Variable... button and add the LIB_JASPERREPORTS variable.

    • Click the Add Class Folder... button and add the samples\fonts directory.

    Set the default output folder option to samples\build and proceed to the next step.

    Figure A.3. Libraries Configuration

    Libraries Configuration
  5. Finish Project Creation

    Click Finish to finish the project creation.

  6. Enable Report Compiler

    Enable the JasperAssistant report compiler for the created project (see Section 7.2, “Compiling Reports”).