Home Data Pentaho 8 Reporting for Java Developers

Pentaho 8 Reporting for Java Developers

By Francesco Corti
books-svg-icon Book
Subscription FREE
eBook + Subscription €11.99
eBook €32.99
Print + eBook €41.99
READ FOR FREE Free Trial for 7 days. €11.99 p/m after trial. Cancel Anytime! BUY NOW BUY NOW BUY NOW
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
READ FOR FREE Free Trial for 7 days. €11.99 p/m after trial. Cancel Anytime! BUY NOW BUY NOW BUY NOW
Subscription FREE
eBook + Subscription €11.99
eBook €32.99
Print + eBook €41.99
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
  1. Free Chapter
    Introduction to Pentaho Reporting
About this book
This hands-on tutorial, filled with exercises and examples, introduces the reader to a variety of concepts within Pentaho Reporting. With screenshots that show you how reports look at design time as well as how they should look when rendered as PDF, Excel, HTML, Text, Rich-Text-File, XML, and CSV, this book also contains complete example source code that you can copy and paste into your environment to get up-and-running quickly. Updated to cover the features of Pentaho 8, this book will teach you everything you need to know to build fast, efficient reports using Pentaho. If your interest lies in the technical details of creating reports and you want to see how to solve common reporting problems with a minimum of fuss, this is the book for you.
Publication date:
September 2017
Publisher
Packt
Pages
470
ISBN
9781788298995

 

Chapter 1. Introduction to Pentaho Reporting

Pentaho Reporting is an easy-to-use, open source, lightweight suite of Java projects built for one purpose: report generation. In this book, you will discover how easy it is to embed Pentaho Reporting into your Java projects, or use it as a standalone reporting platform. Pentaho Reporting's open source license—the GNU Lesser General Public License (LGPL)—gives developers the freedom to embed Pentaho Reporting into their open source and proprietary applications at no cost. An active community participates in the development and use of Pentaho Reporting, answering forum questions, fixing bugs, and implementing new features. While many proprietary reporting options are available, none can offer the openness and flexibility that Pentaho Reporting provides its users with.

As with most successful open source projects, Pentaho Reporting has a proven track record, along with a long list of features. Most of this history has been documented in open forums and in email threads, which are still available for folks to browse through and glean ideas from. Starting as a side hobby and turning into an enterprise reporting suite over the course of many years, the Pentaho Reporting Engine and its suite of tools, such as the Report Designer, Reporting Engine, and Reporting SDK, are used as critical components in countless corporate, educational, governmental, and community-based information technology solutions.

In most business software applications, a reporting component is necessary, be it for summarizing data, generating large numbers of customized documents, or simply for making it easier to print information that would be useful in various output formats. With a complete set of features, including PDF, Microsoft Excel, HTML, Text, XML, CSV, and RTF report generation, along with advanced reporting capabilities such as subreports and cross tabs, Pentaho Reporting can crack the simplest of problems quickly, along with solving the more advanced challenges when designing, generating, and deploying reports.

Read on in this chapter to learn more about Pentaho Reporting, its typical uses, history, and origins, along with a more detailed overview of the reporting functionality that Pentaho Reporting provides.

In this chapter, you will cover the following topics:

  • Introduction to Pentaho Reporting
  • Typical uses of Pentaho Reporting
  • Pentaho Reporting history
  • Pentaho Reporting architecture
 

Introducing Pentaho Reporting


As introduced, Pentaho Reporting is an easy-to-use, open source, lightweight suite of Java projects, built to let the report developer be able to create pixel-perfect reports of his/her data in PDF, Microsoft Excel, HTML, Text, RTF, XML, and CSV formats. These computer generated reports easily refine data from various sources into a human readable form, and can be accessed via an integrated web viewer, saved as files and sent by email to a predefined list of recipients. It is also possible to generate reports as part of a Pentaho Data Integration transformation, to distribute the generated files according to more complex business rules (http://community.pentaho.com/projects/reporting).

Note

Pentaho Data Integration transformations are used to describe the data flows in a process, such as reading from a source, transforming data, and loading it into a target location. You will learn more in Chapter 16Using Reports in Pentaho Data Integration.

As it renders such high performance, consuming, considerably low amount of memory, the report processing can tower from small footprint embedded scenarios to large-scale enterprise reporting scenarios. Pentaho Reporting integrates perfectly with the Business Analytics Platform and allows you to share reports with coworkers and peers.

Pentaho Reporting styling is flexible and it permits the report designer to choose the granularity at which they desire to manipulate the entire user interface, right down to the minute details like the font styling on individual characters. In addition to this, you can also add your own images and logos to these reports and select from the various layouts, charts, and tables the one that you wish to apply.

Introducing Pentaho Reporting tools

Pentaho Reporting can be defined as a suite of open source tools and can be described as being composed of the following: 

  • Report Designer: This is a desktop application providing a design, develop, and test environment to enable the knowledge worker to easily create simple as well as complex reports. The tool is designed to be used by experienced and power users, who are familiar with few technical concepts.
  • Reporting Engine: This engine is born as an evolution of the JFreeReport project, a free Java class library for creating reports. The library can be used in both client-side (Report Designer, for example) and server-side applications (web applications, for example).
  • Reporting SDK: This is a packaging of several resources (the engine, some documentation, and all the libraries required to embed the Pentaho Reporting Engine into your application), to be a valid support for all the developers, particularly, for all the Java developers.

In this book, we will look at the Report Designer and the Reporting SDK in detail, assuming they are the right tools for developers and report designers, to use the Reporting Engine in real life use cases.

Types of users and required knowledge

Pentaho Reporting is designed and developed to make life easier for report designers, with less limitations on flexibility and the ability to develop sophisticated and rich reports. For this reason, the Report Designer can be used by developers (not necessarily Java developers) but also by information technologists with a basic knowledge of databases and technical concepts.

For advanced development, especially using the Reporting SDK, technical skills on Java development are required, and you must be familiar with importing JARs into a project and be comfortable reading inline comments in code, to figure out advanced functionality on your own.

If you are an information technologist with a basic knowledge of databases and technical concepts, the chapters dedicated to the Report Designer and how to use reports in Pentaho Data Integration and Pentaho Business Analytics Platform, are the topics you might be interested in. If you are a Java developer, the chapters about the Reporting SDK could also be interesting to you.

Technological advantages

Pentaho Reporting offers the following unique functionalities, not found in competing embeddable solutions:

  • Requires a Java runtime environment, not necessarily a JDK. Even if you need a JDK installed on your development environment, you do not need a JDK to run an application that embeds the Pentaho Reporting Engine. Only a Java runtime environment is required.
  • Potentially backwards compatible. In theory, Pentaho Reporting can run use dated versions of the Java virtual machine. Pentaho highly suggests to use JRE 1.8.0, but it is possible to use the Reporting Engine in older JRE versions (few integrations would be required).
  • All Processing is done in memory. All the processing, calculations, and algorithms are designed and developed to run in memory only, without the use of temporary files, tables, or any sort of memory mass usage.
  • Low memory requirement. An application based on Pentaho Reporting can run with only 64 MB of memory, even though 128 MB would dramatically increase the report processing speed.
  • Dynamically library loading. Pentaho Reporting Engine is able to detect JAR libraries at runtime. By adding new JARs or removing the existing ones, you can expand the engine's capabilities or remove unnecessary libraries to reduce your application's memory and disk space usage.
  • Parameterization at runtime. All the report elements, and we can say the same for styling, functions, and queries, are completely customizable through parameters passed to the Reporting Engine at run time.
  • OpenFormula standard. OpenFormula is an open standard that will be introduced in the next chapters. You will be able to create your own custom formulas or customize the existing ones using a known standard.
  • Easy resource management. Thanks to the use of the OpenDocument Format (ODF), the Pentaho Reporting Engine can bundle all the requested resources, including the data source connection information, query, and even binary resources like images into a regular file, simplifying the resource management.

A business friendly open source license

One very attractive feature of Pentaho Reporting is its license. Pentaho Reporting is available for free under the GNU LGPL. This license, as shown in the following screenshot, allows other open source and proprietary projects to embed Pentaho Reporting without fear of large license fees or viral open source limitations. As an open source project, developers also have unprecedented access to the engine and to a large group of software developers within the Pentaho Reporting community. This community includes open discussion forums and Internet Relay Chat (IRC), along with commercial support and licensing, if required.

 

Typical uses of Pentaho Reporting


Business users need access to information in many different forms for many different reasons. Pentaho Reporting addresses the following typical uses of reporting, along with many other types that will be covered in this book.

Operational reporting

One of the most commonly used forms of reporting is operational reporting. When a developer or an IT organization decides to generate reports directly from their operational data sources for the purpose of detailed transaction level reporting, it is referred to as operational reporting. In this scenario, the database is designed to solve an operational problem, and usually contains live data supporting critical business functions. Users of Pentaho Reporting can point directly to this data source and start generating reports.

Some examples of operational reporting include building custom reports directly based on a third-party software vendor's database schema. These reports might include summaries of daily activity, or detailed views into a particular project or users in the system. Reports might also be generated from data originating from an in-house custom application. These reports are typically based on an SQL backend, but could be generated from flat log files or directly from in-memory Java objects.

Pentaho Reporting's parameterization capabilities provide a powerful mechanism to render up-to-the-minute customized operational reports. With features such as cross tabs and interactive reporting, business users can quickly view their operational data and drill back into operational systems that might require attention.

However, there are limitations when developing reports based on live operational data. Developers need to be careful to make sure that queries in the operational system do not impact the performance of regular operations. An extreme CPU-intensive query could delay a transaction from taking place. Also, certain historical questions, for example, state transitions or changes to particular informational fields such as address, aren't traditionally captured in an operational schema design.

Business intelligence reporting

When you've reached the limits of operational reporting, the next logical step is to move your data into a data warehouse. This move is often referred to as business intelligence reporting. Reporting alone does not provide the necessary tools to make this transition. You will need an Extract, Transform, Load (ETL) tool, such as Pentaho Data Integration, along with a sensible warehouse design, such as a snowflake schema.

Note

A snowflake schema is a logical arrangement of tables in a multidimensional database, such that the entity relationship diagram resembles a snowflake shape. A multidimensional database is defined as "a variation of the relational model that uses multidimensional structures to organize data and express the relationships between data".

This type of use allows business users to monitor changes over time. It also helps gain performance benefits by pre-calculating aggregations and defining schemas that are built in mind for summarized reporting. Until recently, data warehousing and business intelligence had been limited to large enterprises due to the cost of software and limited expertise. With open source tools becoming more widely available, a large number of small and medium size businesses are deploying data warehouses in order to get solutions for the critical questions in their business domain. Common examples of data warehouse reporting include combining sales and inventory data into a single location for reporting, or combining internal proprietary sales data with publicly available market trends and analysis.

Pentaho Reporting's flexible data source support makes it easy to incorporate reports in your business intelligence solutions. Also, with Pentaho Reporting's speed and scalability, you can deploy Pentaho Reporting with the confidence that reports will be executed efficiently.

As with all approaches, there are limitations to this approach. In traditional warehousing, data is usually batched nightly, weekly, or monthly. Therefore, business users rarely get to see up-to-the-minute reports on business operations. Also, when designing a warehouse, it is important to ask the correct business questions. Unfortunately, it is possible to build a data warehouse and still not address the business users' needs, if not investigated ahead of time.

Financial reporting

The financial reporting is a very specific, but very common, form of reporting, geared towards generating financial summaries for accountants, managers, and business investors. Standard reports that fall into this category include balance sheets, income statements, retained earning statements, and cash flow statements. Unlike business intelligence or operational reporting, many of these reports are required by law, with regulations around their content and presentation. Financial reports often include computations for assets, liabilities, revenues, and expenses.

Following is a screenshot showing one such report:

With features such as group summary aggregations, Pentaho Reporting makes it very easy for developers to implement custom financial reports that business managers and owners require.

Typically, this type of data exists in a controlled form, be it in a proprietary system such as QuickBooks or SAP, or in a secure database system such as Oracle or MySQL. Due to the sensitivity of this data, developers need to be conscious of who has access to the reports and may want to implement features such as audit logging.

Production reporting

Another typical use of Pentaho Reporting includes production reporting. This type of reporting includes reports such as customized form letter, invoice, or postcard for a large audience, as well as automated mail merging. Normally, batch processing is involved in this form of reporting. However, custom reports based on a standard template, generated for individuals, can also fall under this category. 

The following is a screenshot that presents such a report:

There are certain specific features in Pentaho Reporting, such as dynamically incorporating images from a data source, as well as pixel accurate formatting, which can be of real help when implementing production reporting.

       
About the Author
  • Francesco Corti

    Francesco Corti is an enthusiastic consultant in software solutions and loves working in developer, sales, and customers teams. Proud of the role of a software engineer, he is often involved in pre-sales presentations, public speaking, and IT courses. Developing software, designing architectures, and defining solutions in ECM/BPM and BI are his favorite areas of interest. He has completed dozens of projects, from very small ones to more complex ones, in almost 20 years of experience. A product evangelist at Alfresco, Francesco represents the famous open source ECM in the developer community. In addition to helping developers adopt Alfresco technologies, he often helps Alfresco to improve the developer experience through talks, articles, blogging, user demonstrations, recorded demonstrations, or the creation of sample projects. He is the inventor and principal developer of Alflytics (previously named Alfresco Audit Analytics and Reporting), the main business intelligence solution over Alfresco ECM, entirely based on the Pentaho suite. He authored the Pentaho Reporting video course with more than 40 videos and courses on the Pentaho Reporting Designer and SDK. Francesco has specialty and principal experiences in enterprise content management solutions with Alfresco ECM and Hyland OnBase (he is an OnBase certified installer); business process management solutions with Activiti, JBPM, and Hyland OnBase; data capture solutions with Ephesoft, Hyland OnBase, and custom software; record management solutions with O'Neil software and custom software (using Alfresco ECM and Hyland OnBase); and portal and collaboration with Liferay and MS SharePoint.

    Browse publications by this author
Latest Reviews (1 reviews total)
Era justo lo que me hacía falta
Pentaho 8 Reporting for Java Developers
Unlock this book and the full library FREE for 7 days
Start now