The Pentaho Reporting engine is a small set of open source Java classes that enables programmers to retrieve information from a data source, format and process it according to specified parameters, then generate user-readable output. This guide provides guidance and instructions for using the Pentaho Reporting SDK to embed the Pentaho Reporting engine into a new or existing Java application. There are four sample applications in this guide, all of which are included in the SDK as .java files. Each adds one level of complexity or shows a different kind of output.
This document is strictly for Java software developers. 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. Proficiency in connecting to data sources is a helpful skill for developing your own application around the Pentaho Reporting engine, but is not required to follow the examples.
You should read this content in order, from this point all the way to the end of the second example. The remaining articles contain extra information about the Pentaho Reporting engine's capabilities, licensing details, further examples, and information on where to get help and support.
Get started with the Pentaho Reporting SDK
Download the pre-classic-sdk-188.8.131.52-375 file and unpack the Pentaho Reporting SDK archive to a convenient and accessible location. If you use the Eclipse or IntelliJ IDEA development environments, this directory will also serve as your workspace.
In an effort to reduce the size of the SDK, the source code of its constituent libraries is not included. If you need to see the source to any of the software distributed with the Pentaho Reporting SDK, see Source Code Links for instructions.
Use the included Eclipse project
You can also launch the Sample1.java and Sample2.java example applications directly from the file browser in Eclipse.
SDK directory structure
/ /documentation /licenses /samples /WebContent /../META-INF /../WEB-INF /../../lib /lib /source /../org /../../pentaho /../../../reporting /../../../../engine /../../../../../classic /../../../../../../samples /sql
|Where the "Embedding the Pentaho Reporting engine" PDF is located
|Contains text files with licensing information
|The eclipse project directory, which contains the samples shown in this guide
|WebContent information used with Sample 4 (mainly the WEB-INF/web.xml)
|The lib directory which makes up thePentaho Reporting engine SDK
|The source files used to make up the four reporting samples
|The file-based HSQLDB instance used with the samples
Content of the samples directory
|Ant properties used with the build script
|Ant build script
|Ant Build Script
|Settings for Ivy (used with build)
|Dependencies for project (used with Ivy – used with build)
|Eclipse project file
|Eclipse classpath file
|IntelliJ project file
|Runs the sample (1/2/3) program on Windows
|Runs the sample (1/2/3) program from within Eclipse
|Runs the sample (1/2/3) project on linux
|The WAR that can be dropped in a Servlet Container (Tomcat) and executed
Embed the Pentaho Reporting engineinto a Java application
Other embedding scenarios
If phone and email support are not enough, Pentaho can also arrange for an on-site consulting engagement:
You can read all of the relevant licenses in text files in the licenses subdirectory in the Pentaho Reporting SDK.
The following topics help to extend your knowledge of embedding reporting functionality beyond basic setup and use:
- JAR reference
Review a list of the Pentaho-authored and third-party JARs that make up the Pentaho Reporting SDK.
- Source code links
Review a list of individual and modular projects for Pentaho Reporting.
- Sample 3: Dynamically generated, JDBC input, swing output
Use this sample to render a report in a Swing preview window.
- Sample 4: Dynamically generated, JDBC input,
Java servlet output
Use this sample to dynamically generate an HTML reports.