Abhay
Abhay

Reputation: 697

Building Charts in Pentaho Reporting API

I am using Pentaho Reporting 3.5 JAVA API for report generation.I wanted to draw some charts in my report but did not find any thing about how to draw charts with reporting api.

Is it possible to draw charts with this Reporting API??

Upvotes: 0

Views: 1548

Answers (2)

Thomas Morgner
Thomas Morgner

Reputation: 412

Given the fact that the pentaho report designer is able to produce charts, the answer on "is it possible" is a clear yes.

There is some documentation in the Pentaho Wiki describing the general approach.

http://wiki.pentaho.com/display/Reporting/Pentaho+Charting+Extensions

To produce charts you need two cooperative pieces - A Data Collector Function, and a Chart Expression. The data collector function is responsible for creating a JFreeChart dataset type that JFreeChart understands and can use as input data to plot the chart. The Chart Expression is used to actually draw the chart based on the collected data.

The code for these functions can be found in the "legacy-charts" sub-project.

I would recommend that you use the report-designer to get a working chart configuration first. And then have a look at the report and the chart-element and its sub-functions (either by peeking into the PRPT file or by parsing the prpt file and using a debugger, whatever is easier for you).

There is also some good documentation on charts in Will Gorman's book "Pentaho Reporting 3.5 for Java Developers".

Upvotes: 1

Cy Pangilinan
Cy Pangilinan

Reputation: 572

The Reporting API that Pentaho uses for reports is JFreeReport. I believe if you need an API to draw charts, you'll need JFreeChart, since it is the engine that BI Platform uses.

Upvotes: 0

Related Questions