Book Image

Pentaho Reporting 3.5 for Java Developers

Book Image

Pentaho Reporting 3.5 for Java Developers

Overview of this book

Pentaho Reporting lets you create, generate, and distribute rich and sophisticated report content from different data sources. Knowing how to use it quickly and efficiently gives you the edge in producing reports from your database. If you have been looking for a book that has plenty of easy-to-understand instructions and also contains lots of examples and screenshots, this is where your search ends. This book shows you how to replace or build your enterprise reporting solution from scratch with Pentaho's Reporting Suite. Through detailed examples, it dives deeply into all aspects of Pentaho's reporting functionalities, providing you with the knowledge you need to master report creation. This book starts off with a number of examples to get you familiar with the tools and technology of the Pentaho Reporting Suite. Then, with additional examples, it goes into advanced subjects such as charting, sub-reporting, cross tabs, as well as API generation of reports. There are also details and examples on extending Pentaho's open source reporting engine. The reader will learn the ins and outs of Pentaho Report Designer, including a cheat sheet with all the available short-cut keys, to make report design efficient and painless. Embedding reports into your Java application can be difficult. With Pentaho Reporting it's just a few lines of code. The book provides examples of how to embed reporting into your J2EE and client Java applications, as well as showing you how to build dynamic reports from scratch using Pentaho Reporting's simple Java Bean-based report generation API. Setting up and integrating a reporting server in an enterprise environment can be arduous. In addition to learning how to build great embeddable reports, you'll also learn how to combine Pentaho Reporting with Pentaho's BI Server for a zero-code, easy-to-configure, enterprise reporting solution.
Table of Contents (19 chapters)
Pentaho Reporting 3.5 for Java Developers
Credits
Foreword
About the Author
About the Reviewers
Preface
Index

Pentaho Reporting architecture


The Pentaho Reporting Engine is broken up into eleven main Java projects, which are then combined to author and render reports. The Pentaho Reporting Engine is backward compatible to Java 1.2.2, making certain that it stays as lightweight and as useful as possible. Most of the eleven libraries are independently useful for Java developers, outside of using them strictly for reporting purposes. The following diagram describes the various dependencies between each of the reporting projects:

LibBase

LibBase is the root library for all other Pentaho Reporting libraries. This library contains common capabilities, such as debug and error logging utilities, library configuration, along with library initialization APIs, for consistent startup and shutdown management of the reporting engine.

LibDocBundle

LibDocBundle abstracts the management of Pentaho Reporting file bundles, which are by default stored as ZIP files, and implements the OpenDocument format (ODF). This makes it simpler for other parts of the reporting engine to work with and manipulate Pentaho Reporting's file formats.

LibFonts

LibFonts allows Pentaho Reporting to work with TrueType system fonts, extracting the necessary metadata from font types, populating an abstract interface to allow appropriate rendering in various contexts, including PDF and Excel views.

LibFormat

LibFormat is a string formatting library, which can render dates and numbers appropriately based on format strings. This library is focused on memory and CPU efficiency for high performance report rendering.

LibFormula

LibFormula is a formula parsing and execution library based on the OpenFormula standard. You can learn more about OpenFormula by visiting http://wiki.oasis-open.org/office/About_OpenFormula. This library is similar in function to Excel-based formula definitions. LibFormula is a very general library, and is used outside Pentaho Reporting in other projects that require OpenFormula style parsing and execution.

LibLoader

LibLoader manages the loading and caching of all necessary resources required for generating reports in a generic way, providing a simple API for other parts of the reporting engine that control static and dynamic content, including data sources and images.

LibRepository

LibRepository abstracts the input and output of hierarchical storage systems, such as file systems, that Pentaho Reporting interacts with. This makes it possible for a custom storage system such as FTP, to be implemented and to be mapped to the API, giving Pentaho Reporting access to the system.

LibSerializer

LibSerializer provides helper methods for serializing non-serializable objects. This is necessary so that the reporting engine can serialize standard Java classes that don't implement Java's Serializable interface.

LibXml

LibXml provides utility classes for SAX (Simple API for XML) parsing and XML writing, based on Java's JAXP (Java API for XML Parsing) API. This library assures the speedy loading and validation of Pentaho Reporting XML template files.

Report Engine Core

The Report Engine Core project contains the main reporting algorithm for rendering reports, along with the necessary functionality to support styling. This project also contains the algorithms for rendering specific outputs, including PDF, Excel, CSV, XML, and more. The engine relies on the already mentioned Lib libraries for managing the loading, parsing, formatting, rendering, and archiving of generated reports.

Report Engine Extensions

The Report Engine Extensions project contains third-party extensions to the reporting engine, which are very useful, but increase dependencies. Extensions in this project include JavaScript Expression support using the Rhino project, a Hibernate data source factory, Barcode support using Barbecue, Sparkline support, along with additional JDK 1.4 support for configuration and printing. Additional extension projects exist that include charting and many of the data sources discussed in this book.

When combined, these libraries form the Pentaho Reporting Engine. In addition to these libraries, there are also other related open source tools and projects in the Pentaho Reporting landscape, including the Report Engine Demo, Report Design Wizard, Report Designer, and the web-based Ad Hoc Reporting user interface.