Home > Getting Started
 
  JasperReports Getting Started      
 
  • Primary Audience: Java developers
  • Secondary Audiences: script and other software developers (PHP, Perl, C/C++, web services)

Step 1: Download JasperReports project files

Environment Commands


Linux


Download and extract jasperreports-<ver>-project.tar.gz to a new folder, e.g.: /opt/jasperreports-<ver>


Windows


Download and extract jasperreports-<ver>-project.zip to a new folder, e.g.: c:\program files\jasperreports-<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.


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: Start the sample database

Open a Command Prompt window and execute the following commands.

Environment Commands


Linux

 

  • [prompt] cd /opt
  • [prompt] cd jasperreports-<ver>/demo/hsqldb
  • [prompt] ant runServer


Windows

 

  • prompt> cd \program files
  • prompt> cd jasperreports-<ver>\demo\hsqldb
  • prompt> ant runServer

 

Step 4: 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.

Environment Commands


Linux

 

  • [prompt] cd /opt
  • [prompt] cd jasperreports-<ver>\demo\samples
  • [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 build\reports
  • [prompt] ant clean


Windows

 

  • prompt> cd \program files
  • prompt> cd jasperreports-<ver>\demo\samples
  • 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 build\reports
  • prompt> ant clean

 

Suggested Next Steps

  • Purchase a single copy of The Ultimate Guide to JasperReports, or an annual subscription, which entitles you to a full year of documentation updates.

  • Download and install the iReport graphical report designer for JasperReports.

  • 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 jaserreports-<ver> root directory).