Pentaho Reporting never had real charting support. Although JFreeChart, the reference project for Java-based charting, was developed next door, we never came to the point where users could have added charts to a report.
The engine itself is able to render Drawable-objects. Drawables are objects that know how to render themselves to a Graphics2D context. This interface was defined by JFreeChart as simple abstraction layer for its components. So the only way to get charts into the report, was to print them as drawables. If you wanted charts based on the data from the report, you would have to create a function that collects the data and finally creates the JFreeChart instance, which then could be printed in the report.
This story is sick, I know. But we haven’t even reached the end yet.
When Pentaho elected JFreeReport to be the primary Reporting Engine for their plattform, they also asked about charting. Naive as I was, I mentioned that sick way of getting charts into the report. Even worse, I’ve created a working sample-report for them so that they can see it working.
Oh, I should have known better. Every sin gets punished sooner or later, and my punishment is called ‘ChartExpression’. The prototype actually evolved into a couple of function implementations. The Pentaho folks still think, that this was a natural evolution born out of the need for at least some charting capabilities. But I know better: The gods of good software architecture were really pissed of at me, just for creating that abnomination. If there were some deserts near by, you would now see me heading of for a 40 year tip to nowhere, just to end my life directly in front of the promised land.
So all you developers out there: If someone asks you for a quick solution for a problem, and all you could deliver is an architectural nighmare: turn them down. Tell’em: ‘No way! There is no possibility how this can be done right now.’
If you feel lucky, you might even ask them for a project budget to develop something sane.
But never ever say the unholy sentence: “Sure, we can build something quick and dirty. We’ll create a better solution as soon as we find more time for it.”
That time will never come …