Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Table of contents

  1. #1
    Join Date
    Jan 2008
    Posts
    7

    Default Table of contents

    Hi everyone,

    How can I produce a table of contents for my report? I'd like to include a page up front with links to each group header. If it's possible to produce a nested table of contents (for when nested groups are in use), this would be even better.

    -Jonathan

  2. #2
    Join Date
    May 2008
    Posts
    3

    Default

    I would also like to know how best to accomplish this.

  3. #3
    Join Date
    Jan 2008
    Posts
    7

    Default

    It turns out you can't. See: http://jira.pentaho.com/browse/PRE-218.

    We're going to do this with an ugly iText hack. Hopefully iText will be able to help us find the headings.

    We have this luxury because the business requirements only specify PDF output. If you have to do this for HTML and Excel output too, you've got 3 times more work ahead of you than me!

  4. #4
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Actually, it depends on how you define TOC.

    The part that we cannot deliver in a sane way for now is the page-numbers on the report. If you leave out the page-number requirement, then you'll be able to solve this with a subreport on the report-header that prints the summary information (using the same query as the master report, or if you feel like optimization, using a aggregate query that only returns the records for the headings using the GROUP BY clause of SQL).

    The subreport then has to contain the links to the content (just the string "#" + the anchor you want to jump to), which can be solved using a simple style-expression on the HREF-stylekey.

    The master report is responsible for generating the anchors (link targets) so that the hyperlinks know where to point to. This can be solved by a style-expression on the (lets say Group-Header) for the style-key "anchor-name". The computed name must be the same as the link's name but without the "#". So if your link goes to "#Classic-Cars" then the anchor must be "Classic-Cars".

    If you use the group's field names as link text, you should have no problem ensuring that your anchor is unique.

    This works for both HTML and PDF exports.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  5. #5
    Join Date
    Jan 2008
    Posts
    7

    Default

    Thanks for the response. I appreciate you taking the time to point this out!

    It's good to know this technique, but unfortunately I can't satisfy the project requirements without providing the page numbers too.

    -Jonathan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.