| Summary: | Table of contents PDF | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Peter <p.andersson> | ||||
| Component: | BIRT | Assignee: | Yu Chen <yChen> | ||||
| Status: | VERIFIED WORKSFORME | QA Contact: | H N <hng> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | bluesoldier, hng, Lionel.wyl, p.andersson, zqian | ||||
| Version: | 2.6.1 | ||||||
| Target Milestone: | 4.4.1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | Obsolete | ||||||
| Attachments: |
|
||||||
Would you please attach your report design for me to investigate? (In reply to comment #1) > Would you please attach your report design for me to investigate? Finally I decided to rewrite my code and use grouping functionallity of Birt and get the Table of contents that way. I do not have a report design that you can use since I have rewritten the code that generates it. What I would like to do is in an event handler check if the current row is a sum(from the other system) and if it is add a toc entry for it, e.g. if ( sumrow ) { rowInstance.addTOCEntry(level, tocEntryText) } But since I have worked around this it is ok to close the bug (but I think it could be useful to have this funtionallity in the future). Kind regards Peter The TOC on data item of detail row can be set in the TOC expression builder in UI. (In reply to comment #3) > The TOC on data item of detail row can be set in the TOC expression builder in > UI. Yes, this was what I tried to do (programmtically) as described above. I was trying to use a java script to return the string to be used as an toc-entry. The problem I had with this approach was that when the script did not return anything ( e.g. when a cell value was empty ) an empty toc-entry was created (in pdf). If the java script does not return anything (or an empty String) I do not think that an toc-entry should be created. reopen Mark as fixed. see commit 5cf597718cdf1651eab6f6b0909050ab59d51025. UI to create expression for TOC item is available. Groups that does not have value are not shown in the TOC. Verified in BIRT 4.4.1 build v20140909-0320. |
Created attachment 185908 [details] Example report with empty Bookmarks. Hi, I'm using Birt to create pdf reports from data that already has sums and groupings therefore I do not want to use the grouping functionallity of Birt. But I want bookmarks in the pdf for every grouping level. I´ve tried to achieve this by adding a JavaScript to the DataItem of a table using this: data.addTOC("if (!BirtComp.compareString(row[\""+reportColumn.getName()+"\"],\"\")){\"\"+row[\""+reportColumn.getName()+"\"];};"); I hoped that this would generate a TOC-node for every row where reportColumn.getName() returns a value but it creates an empty TOC-node for rows with blank values, see the attaced file for an example. What I want is that if the java script returns blank then no TOC-node will be created. Or even better if it would be possible to create the TOC in an event handler at render runtime then you could create a TOC-node for a cell in a table based on its value. I would very much appreciate if this could be solved. Regards Peter