Skip to main content

Pentaho+ documentation has moved!

The new product documentation portal is here. Check it out now at docs.hitachivantara.com

 

Hitachi Vantara Lumada and Pentaho Documentation

Embed reporting functionality

Parent article

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

You can download the latest Pentaho Reporting software development kit (SDK) from the Customer Support Portal.

Download the pre-classic-sdk-8.3.0.0-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

If you use the Eclipse or IntelliJ IDEA development environments, you can use the Eclipse project included with the Pentaho Reporting SDK to work directly with the example source code. Simply select the unpacked Pentaho Reporting SDK directory as your workspace.

You can also launch the Sample1.java and Sample2.java example applications directly from the file browser in Eclipse.

SDK directory structure

The following elements are delivered in the SDK directory structure:
/
/documentation
/licenses
/samples
/WebContent
/../META-INF
/../WEB-INF
/../../lib
/lib
/source
/../org
/../../pentaho
/../../../reporting
/../../../../engine
/../../../../../classic
/../../../../../../samples
/sql
DirectoryContent Description
DocumentationWhere the "Embedding the Pentaho Reporting engine" PDF is located
LicensesContains text files with licensing information
SamplesThe eclipse project directory, which contains the samples shown in this guide
Samples/WebContentWebContent information used with Sample 4 (mainly the WEB-INF/web.xml)
Samples/libThe lib directory which makes up thePentaho Reporting engine SDK
Samples/sourceThe source files used to make up the four reporting samples
Samples/sqlThe file-based HSQLDB instance used with the samples

Content of the samples directory

The following files appear in the Samples directory:
FilePurpose
build.propertiesAnt properties used with the build script
build.xmlAnt build script
common_build.xmlAnt Build Script
ivysettings.xmlSettings for Ivy (used with build)
ivy.xmlDependencies for project (used with Ivy – used with build)
.projectEclipse project file
.classpathEclipse classpath file
samples.imlIntelliJ project file
Sample*.batRuns the sample (1/2/3) program on Windows
Sample *.launchRuns the sample (1/2/3) program from within Eclipse
Sample*.shRuns the sample (1/2/3) project on linux
Sample4.warThe WAR that can be dropped in a Servlet Container (Tomcat) and executed

Embed the Pentaho Reporting engineinto a Java application

Build a simple reporting application around the Pentaho Reporting engine in a Java application.

Learn more

Other embedding scenarios

Besides the reporting engine, you can embed or extend the Pentaho Analyzer engine (Mondrian), the Pentaho BI Platform, part or all of Pentaho Data Integration (Kettle), and the Weka data mining engine.

Learn more

Developer support

The examples in this section are simple and easy to follow, but with more complex requirements come more advanced programs. While reading the source code comments can help quite a bit, you may still need help to develop an application within a reasonable time-frame. Should you need personal assistance, you can have direct access to the most knowledgeable support resources through a Pentaho Enterprise Edition software vendor annual subscription:

ISV/OEM support options

If phone and email support are not enough, Pentaho can also arrange for an on-site consulting engagement:

Consultive support options

License information

The entire Pentaho Reporting SDK is freely redistributable. Most of it is open source software, but its constituent JARs are under a few different licenses. If you intend to embed and distribute any part of this SDK, you must be familiar with the licensing requirements of the pieces you use.

You can read all of the relevant licenses in text files in the licenses subdirectory in the Pentaho Reporting SDK.

Advanced topics

The following topics help to extend your knowledge of embedding reporting functionality beyond basic setup and use: