Jasper Reports
Jasper Reports
-------------------------------------------------------------------------------------------------------
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 1
JAVA Means DURGA SOFT
Jasper Reports
Introduction:
Jasper Reports is a popular open-source reporting engine whose
main purpose is to help creating page oriented, ready to print documents in a simple
and flexible manner. Jasper Reports is written in 100% Java and can be embedded
in any Java application. Jasper Reports has the ability to deliver rich content in
various formats such as PDF, HTML, XLS, CSV, XML files, or directly on the
screen or printer.
-------------------------------------------------------------------------------------------------------
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 2
JAVA Means DURGA SOFT
Eg:
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report
Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="Simple_Report">
<detail>
<band
height="2
0">
<staticTex
t>
<reportElement x="180" y="0" width="200"
height="20"/> <text><![CDATA[Hello
World!]]></text>
</staticText>
</band>
</detail>
</jasperReport>
<title> - its contents are printed only once at the beginning of the report
<pageHeader> - its contents are printed at the beginning of every page in
the report.
-------------------------------------------------------------------------------------------------------
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 3
JAVA Means DURGA SOFT
<pageFooter> - its contents are printed at the bottom of every page in the
report.
<band> - defines a report section, all of the above elements contain a band
element as its only child element.
form (for later use), can be delivered to the printer or to the screen, or can be
exported into a PDF, HTML, XLS, RTF, ODT, CSV, TXT or XML document.
As you can see, the main classes to use when working with JasperReports are:
net.sf.jasperreports.engine.JasperCompileManager
-------------------------------------------------------------------------------------------------------
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 4
JAVA Means DURGA SOFT
net.sf.jasperreports.engine.JasperFillManager
net.sf.jasperreports.engine.JasperPrintManager
net.sf.jasperreports.engine.JasperExportManager
These classes represent a façade to the Jasper Reports engine. They have various
static methods that simplify the access to the API functionality and can be used to
compile an JRXML report design, to fill a report, to print it, or to export to other
document formats (PDF, HTML, XML).
Generated reports can be viewed using the JasperViewer application. In its main ()
method, it receives the name of the file which contains the report to view.
After having filled a report, we can also export it in PDF, HTML or XML format
using the exportReportXXX() methods of the JasperExportManager class.
-------------------------------------------------------------------------------------------------------
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 5
JAVA Means DURGA SOFT
-------------------------------------------------------------------------------------------------------
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 6
JAVA Means DURGA SOFT
-------------------------------------------------------------------------------------------------------
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786 Page 7