Jump to content
Changes to the Jaspersoft community edition download ×
  • JasperReports Library - First Steps


    Giulio Toffoli
    • Version: v8.2 Product: JasperReports® Library

    • Primary Audience: Java developers
    • Secondary Audiences: script and other software developers (PHP, Perl, C/C++, web services)
    [toc on_off::hide=0 box::collapsed=1]

    Step 1: Download JasperReports project files

    EnvironmentCommands
    LinuxDownload and extract jasperreports-{ver}-project.tar.gz to a new folder, e.g.: /opt/jasperreports-{ver}
    WindowsDownload and extract jasperreports-{ver}-project.zip to a new folder, e.g.: c:program filesjasperreports-{ver}

    JasperReports is a library that you embed in another application. "Installing" JasperReports simply means including the JasperReport "jar" file in the classpath of your application along with other required jar files. JasperReports can be downloaded from the Releases tab on the JasperReports Library Project Home Page.


    Step 2: Download and install Ant

    JasperReports uses the Ant build tool from the Apache Foundation to compile source files, build the distribution files, generate the JavaDoc documentation, and run the samples.

    Download Ant from http://ant.apache.org. For installation instructions, visit http://ant.apache.org/manual/index.html.


    Step 3: Download and install Apache ivy

    Download Apache ivy zip folder from https://ant.apache.org/ivy/download.cgi and copy the ivy-2.5.1.jar file from the ivy folder to <ANT_HOME>lib.


    Step 4: Start the sample database

       Note: For Windows 7, command prompt is required to be run in 'Run As Administrator' mode.

    EnvironmentCommands
    Linux
    • prompt> cd /opt
    • prompt> cd jasperreports-{ver}/demo/hsqldb
    • prompt> ant runServer
    Windows
    • prompt> cd program files
    • prompt> cd jasperreports-{ver}demohsqldb
    • prompt> ant runServer

    Step 5: Run the sample applications

    The JasperReports project files include a complete set of sample applications and reports that show how individual JasperReports features can be used.

    Open another Command Prompt window and run the following commands in sequence to see some of the features available in the barcode sample application. As you become comfortable with the ant -p command, move on to other samples.

    EnvironmentCommands
    Linux
    • prompt> cd /opt
    • prompt> cd jasperreports-{ver}demosamples
    • prompt> dir
    • prompt> cd barbecue
    • prompt> ant -p
    • prompt> ant javac
    • prompt> ant compile
    • prompt> ant fill
    • prompt> ant view
    • prompt> ant viewDesign
    • prompt> ant run
    • prompt> dir buildreports
    • prompt> ant clean
    Windows
    • prompt> cd program files
    • prompt> cd jasperreports-{ver}demosamples
    • prompt> dir
    • prompt> cd barbecue
    • prompt> ant -p
    • prompt> ant javac
    • prompt> ant compile
    • prompt> ant fill
    • prompt> ant view
    • prompt> ant viewDesign
    • prompt> ant run
    • prompt> dir buildreports
    • prompt> ant clean

    Suggested Next Steps

    • Get a free copy of JasperReports Library Ultimate Guide
    • Download and install the Eclipse-based designer, Jaspersoft Studio.
    • Compile the source files, generate the JavaDoc API documentation, or build the distribution JAR files. Execute the Ant tasks declared in the build.xml file found in the root directory of the project tree (type ant p at the jasperreports-{ver} root directory).

    User Feedback

    Recommended Comments

    ----------
    BUILD FAILED
    C:jasperjasperreports-6.17.0demohsqldbbuild.xml:6: Problem: failed to create task or type antlib:org.apache.ivy.ant:configure
    Cause: The name is undefined.
    Action: Check the spelling.
    Action: Check that any custom tasks/types have been declared.
    Action: Check that any <presetdef>/<macrodef> declarations have taken place.
    No types or tasks have been defined in this namespace yet

    This appears to be an antlib declaration.
    Action: Check that the implementing library exists in one of:
            -C:apache-antapache-ant-1.10.10lib
            -C:Usersxxxxxxxxxx.antlib
            -a directory added on the command line with the -lib argument


    Total time: 0 seconds
    ----------

    It was resolved when I downloaded apache-ivy-2.5.0-bin.zip from http://ant.apache.org/ivy/, unzipped it, and copied ivy-2.5.0.jar to <ANT_HOME>lib.
    I don't know if this is the correct solution.

     

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...