An open-source Java class library.
Designed to aid developers with the task of
adding reporting capabilities to Java
Provide an ability to facilitate the ability to
generate reports from any kind of Java
It is embedded into Java applications by
including its library in the application's
It has flexible report layout.
It is capable of presenting data textually or
It allows developers to supply data in multiple ways
(e.g. Parameters, datasources).
It can accept data from multiple datasources (e.g.
XML, POJO's, java.util.Map).
It can generate Subreports.
It can generate watermarks.
It can capable of exporting reports to a variety of
formats (e.g. pdf, HTML, excel).
Compile JRXML into Jasper template
Fill the Jasper
template to generate the report
Export the Report
Report is printed or
displayed on screen
Downloading Jasper Reports
Download latest jasper reports jar file from
Following are Jasper Report dependencies:
Commons Logging Used for sending output to log
Commons Collections Used to manage collections of data
Commons BeanUtils User for Java Beans Introspection
Commons Digester Used for XML parsing
JFreeChart Only requires when the report contains chart
iText Only requires when exporting reports to PDF or
Hibernate Only required when writing report using the
Hibernate Query Language (HQL)
title: It is created only once and can be printed on a
pageHeader: The page header appears on all
printed pages in the same position defined during
the design phase.
columnHeader: This band is printed at the
beginning of each detail column.
detail: A detail band corresponds to every record
that is read by datasource that feeds the report.
background: This element is used to define the
page background for all pages in the report. It
can be used to display images or text and also to
columnFooter: This band appears at the end of
every column. Not resizable at run time.
pageFooter: This band appears on every page
where there is a page header.
lastPageFooter: If you want to make the last page
footer different then it is possible to use the
special las page footer band.
summary: This band allows you to insert fields
concerning total calculations, means, or whatever
you want to insert at the end of the report.
Elements in JRXML
<staticText> : Defines static text that does not
depend on any datasources, variables,
parameters, or report expressions.
<textField>: Used to display dynamic textual data
<textFieldExpression>: Defines the data that is
displayed in text fields.
<field>: This element is used to map data from
datasources or queries into report templates.
Fields can be combined in report expressions to
obtain the necessary output. A JRXML template
can contain zero or more <field> elements.
<variable>: Report expressions, used several
times in a report, can be assigned to variables to
simplify the template. A JRXML template can
contain zero or more <variable> elements.
<parameter>: This element is used to define report
parameters. Parameter values are supplied via a
java.util.Map by calling the appropriate methods
in the JasperReports API. A JRXML template
can contain zero or more <parameter> elements.
<group>: This element is used to group
consecutive records in a datasource sharing
some common characteristics. A JRXML
template can contain zero or more <group>