How would you feel if you knew you could each of the million features of JFreeChart to work within the Pentaho Reporting System? After all, it is a ugly thing for a consultant or system developer to say “no, sorry, can’t do that” to a customer or client. Especially when you have that shiny new JFreeChart Developer Guide on your desk telling you that there is a way.
Imagine a world without sentences like “Uh .. sure JFreeChart supports this feature, but it is not exposed in the Report Designer”.
Well, with Pentaho Reporting 3.7 you can live in that world right now.
Like the well-known BeanShell- and BSH-Expressions, a set of predefined variables grants access to the outside world.
“chart” is the fully initialized JFreeChart object.
“dataRow” grants access to the values of the other named expressions and the data-table
“runtime” grants access to the current ExpressionRuntime instance. The runtime itself allows the use of the ResourceBundles (for internationalization) and grants access to the report’s defined DataFactories (to get more data from the outside world).
A simple post processing script could look like this (Language = BeanShell):
import java.util.Date; chart.setTitle("My Title: " + new Date());
But with the ability to fire queries, you can easily add your own line or item marker to explain significant details or enrich the plots with your own styling.
Your imagination (and coding abilities) are the limit now!