Will Gorman recently recreated a Google Analytics report in Pentaho Reporting. While the output looks reasonable good, the road to it was more painful than necessary.
Will’s direct feedback showed that he was not aware of a bunch of helping hands inside the Pentaho Report Designer which make it quite easy to create professional looking reports that just shine. Aside of that he also uncovered a bunch of usability issues. But luckily, many of these troubles are caused by just a few invalid settings. Lets have a look what he encountered and how we can make the pain go away.
- The Swing Colour Picker really really sucks big time. But hey, that’s why the next big release will have a totally new colour picker on board.
- Charting and the massive overload of chart properties caused him some headaches. At the moment, charting is really not fun – it does its job, but it severely needs some better documentation. Up until now, Will’s book on Pentaho Reporting is still the best documentation out there.
- Aligning elements was Will might describe as “painful”.
- Getting the elements inside the sub-reports align right with elements outside of the sub-report was … not fun.
When I opened the first edition of the report Will sent around, I instantly smelled trouble. This is what I have seen:
The red boxes mark overlapping elements. This will cause troubles when we export to any of the table-based layouts. The grey lines mark element boundaries. For a report that simple there are way to many of them here.
Now, why would Will create a report with random element positions in the first place? After all, Will is a full-blood engineer – so randomness for artistic bonus points is not an answer. The answer lies within the default settings of Pentaho Reporting 3.5 to 3.8. This is how Will has seen the same report:
The default settings of the Pentaho Report Designer hide all the helpful details from you.
With all helpers enabled, unaligned elements are outright visible, overlaps are clearly marked and the designer is actually encouraged to let elements snap into their best positions. A clean layout would have looked somewhat close to this.
The Pentaho Report Designer comes with four major tools to help you to create better reports:
View->Snap to Elements and View->Element Alignment Hints
This powerful voodoo snaps element boundaries to each other. If your element comes close to a existing boundary, it will attach to it and will stay attached until it leaves the attraction zone. This makes positioning elements a easy task. The first element can be placed randomly, and all other elements will snap to this particular position.
In Pentaho Report Designer 4.0, this feature will be enabled by default. It is a must have and I never design reports without it!
View->Show Overlapping Elements
This makes overlapping elements visible in the editor. Overlapping elements are prohibited when you want to export reports to HTML, Excel, CSV or RTF. These report outputs use tables as their layouting and output mode and each table-cell can only be filled once.
Overlapping elements would fight over the right to use the cell, and as a result the layout would be destroyed. Inside the reporting engine we avoid the troubles by using a “first-come-first-serve” strategy. That means, only the first element can occupy the cell, everyone else gets evicted.
Just like the Snap-To-Elements, this is a must-have. You simply cannot edit a report and not have a clear warning about overlapping elements.
This allows you to align your elements according to a predefined grid. The default grid-size is 5 point and moving elements lets them jump from grid-position to grid-position. This feature alone already reduces the amount of randomness in the element sizes.
But personally, I don’t use this at all, as it limits my perceived ‘artistic freedom’. Your mileage may vary.
Guides and View->Guides->Snap
Guides work similar to the grid and the Snap-To-Elements feature. You can position guides so that they reflect the important alignment edges of your report output.
And last but not least, there is the row layout strategy for bands for whenever you need to design list-style reports quickly. With a row-layout you don’t have to worry about element alignment or overlapping elements at all, as the row-layout prevents that out of the box.