Free Sample
+ Collection

JasperReports for Java Developers


Create, Design, Format and Export Reports with the world's most popular Java reporting library
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781904811909
Paperback344 pages

About This Book

  • Get started with JasperReports, and develop the skills to get the most from it
  • Create, design, format, and export reports
  • Generate report data from a wide range of datasources
  • Integrate Jasper Reports with Spring, Hibernate, Java Server Faces, or Struts

Who This Book Is For

This book is for Java developers who want to create rich reports for either the web or print, and want to get started quickly with JasperReports to do this. No knowledge of JasperReports is presumed, although obviously familiarity with Java, SQL, and XML are assumed where they are required.

Table of Contents

Chapter 1: An Overview of JasperReports
Brief History of JasperReports
What is JasperReports?
The JasperReports Open-Source License
Features of JasperReports
Class Library Dependencies
Typical Workflow
Where to Get Help?
Chapter 2: Adding Reporting Capabilities to Java Applications
Downloading JasperReports
JasperReports Class Library
Chapter 3:
Creating a JRXML Report Template
Generating the Report
Displaying Reports on a Web Browser
Elements of a JRXML Report Template
Chapter 4: Creating Dynamic Database Reports
Database for Our Reports
Generating Database Reports
Chapter 5: Working with Other Datasources
Empty Datasources
Map Datasources
Java Objects as Datasources
TableModels as Datasources
XML as Datasource
Custom Datasources
Chapter 6: Report Layout and Design
Controlling Report-Wide Layout Properties
Setting Text Properties
Setting a Report's Background
Adding Multiple Columns to a Report
Grouping Report Data
Report Expressions
Report Variables
Stretching Text Fields to Accommodate Data
Laying Out Report Elements
Using the <frame> Element
Hiding Repeated Values
Chapter 7: Adding Charts and Graphics to Reports
Adding Geometrical Shapes to a Report
Adding Images to a Report
Adding Charts to a Report
Chapter 8: Other JasperReports Features
Report Localization
Adding Hyperlinks and Anchors to Reports
Handling Very Large Reports
Chapter 9: Exporting to Other Formats
Exporting Overview
Exporting to PDF
Exporting to RTF
Exporting to Excel
Exporting to HTML
Exporting to XML
Exporting to CSV
Exporting to Plain Text
Directing HTML Reports to a Browser
Chapter 10: Graphical Report Design with iReport
Obtaining iReport
Creating a Database Report in Record Time
Creating a Report "From Scratch"
Creating More Elaborate Reports
Help and Support
Chapter 11: Integrating JasperReports with other Frameworks
Integrating JasperReports with Hibernate
Integrating JasperReports with Spring
Integrating JasperReports with JavaServer Faces
Integrating JasperReports with Struts

What You Will Learn

  • Overview of JasperReports, and what it can do for you
  • Adding reporting capabilities to your application
  • Creating and formatting reports
  • Report layout and design
  • Working with database datasources
  • Working with other types of datasource such as arrays, collections, TableModels and XML
  • Creating subreports
  • Adding charts and graphics to a report
  • Working with the iReport report designer
  • Exporting reports to PDF, Excel spreadsheet or Word document format
  • Integrating JasperReports with other Java frameworks like Spring, Java Server Faces, Struts, and Hibernate

In Detail

JasperReports is the world's most popular embeddable Java open source reporting library, providing Java developers with the power to easily create rich print and web reports. This book shows you exactly how to get started, and develop the skills to get the most from JasperReports.

The book steers you through each point of report setup, to creating, designing, formatting, and exporting reports with data from a wide range of datasources, and integrating JasperReports with other Java frameworks.

Starting with the basics of adding reporting capabilities to your application, and creating report templates you will first see how to produce your reports through the use of JRXML files, custom ANT targets, and then see preview them in both the browser and the native browser of JasperReports.

Getting data into your reports is the next step, and you will see how to get data from a range of datasources, not only databases, but XML files, and Java Objects, among others.

You will create better looking reports with formatting and grouping, as well as adding graphical elements to the report. You will export your reports to a range of different formats, including PDF and XML.   

Creating reports will be made even easier with a walkthrough of the iReport Designer visual designing tool. To round things off, you will see how to integrate your reports with other Java frameworks, using Spring or Hibernate to get data for the report, and Java Server Faces or Struts for presenting the report.


Read More