Now that you've built a report using Pentaho Reporting's XML format, it's time to learn how to do a similar exercise, by building a report using Pentaho Reporting's Java API. To avoid going over the entire Javadoc of Pentaho Reporting, this chapter covers only the essentials. This includes references to important packages, making it easier to find the classes, factories, and interfaces that you need to build your report. Pentaho Reporting's Javadoc is available at http://javadoc.pentaho.com/reporting/
The first step in working with Pentaho Reporting's API is to initialize the reporting engine and create an empty MasterReport
object.
// Initialize the reporting engine ClassicEngineBoot.getInstance().start(); // Create a report object MasterReport report = new MasterReport();
The ClassicEngineBoot
and MasterReport
classes are located in the org.pentaho.reporting.engine.classic.core
Java package.
Once you've created a report object, you're...