Table of contents and of figures in pentaho report designer
I want to generete the table of contents and of figures of my report and i couldn't find a way to manage I'm running pentaho report designer 2.0.0 stable.
Anyone has an idea how to do it please?[/QUOTE]
I've been trying to get this done with some javascript code and css class names.
I couldn't get it to work because the PUC report viewer creates a new HTML document for every page, and I couldn't get my Javascript to reference accross pages.
This did work in PRD (>= 3.5) though, where reports are displayed as a single page.
Have a look at the CI builds for both 3.6 and 3.7 - and you will now find new icon in the list of available elements. It looks like a subreport, smells like a subreport, but is named "table-of-contents". And it generates what the name says.
The data-generation can be controlled via a couple of attributes on the toc-element itself. The layout can be defined by ordinary subreport means - so just drag labels, fields and so on onto the subreport and you are there. Please note that redefining the subreports datafactories or queries has no effect, as they get reset at runtime.
Create a IndexTextGeneratorFunction in your main report, name it "index-gen" and then add the following formula to the "html-anchor" style:
=[index-gen]
make sure your index-gen function is configured in the same way as your toc-element, so that you get consistent results between the generated index here and the one found inside the TOC report.
And then in the TOC, just add a "href-target" style-expression to your elements, with the following formula
="#" & [item-index]
The linking works in both HTML and PDF reports, but not in the Swing-preview or in the Excel-target (same behaviour as before).