generating a table of contents from a row set [message #39178] |
Mon, 23 May 2005 13:28  |
Eclipse User |
|
|
|
Hello I'm trying to generate a table of contents to a row set of data.
something like
1. Book Name 'the Last Bastelope'
1.1 Book Overview
1.2 Book Details
2. Book Name 'Where the Wild Things Grow'
2.1 Book Overview
2.2 Book Details
Any idea how this would look
say I have a row set taht repeats like
BookName, Book OverView, Book Details
....,...,...
|
|
|
|
Re: generating a table of contents from a row set [message #40599 is a reply to message #39274] |
Tue, 24 May 2005 18:49  |
Eclipse User |
|
|
|
Mike,
Another great question!
The ROM specs mention a proposed TOC control that would automatically do
what you want. Unfortunately, it's not in R1, so we have to be a bit
creative.
You can create the TOC simply by adding a table to the top of your report,
then make two passes over your data: one to create the TOC, another to
create the rest of the report.
Numbering can be done using the the runningSum( ) aggregate function; just
do a runningSum( 1 ). (Yes, it would be nicer to have a runningCount( );
perhaps we should file that as a Bugzilla enhancement.) The runningSum( )
will probably work for the second digit, I suspect it won't work for the
first. For that, you may have to do a bit of scripting.
Aggregates take an optional group argument. So, in your TOC, create a group
for Book Name. In the onStart( ) method for your group, increment a group
counter JavaScript variable.
In the group header, add a data item for the "1.", "2.", etc. using the
group counter.
In the detail row, add a data item for the "1.1", "1.2" value, building up
the value using the group counter and the runningSum( 1 ) expression.
Once we get a clarification from the team about whether the bookmark
property works, that will tell us how to create the link.
The page number is a problem in this release; BIRT needs to work with Apache
FOP to perform such page numbering, but that is not supported in Release
1.0.
Similarly, the dots are a problem. Your goal is probably to align the
numbers, and use dots to fill in the gap between the text and number. This
is very hard to do unless the tool has exact font knowledge. Web browsers
generally don't have such knowledge, and BIRT does not have it (in Release
1.0) for PDF. A workaround would be to use shading to help guide the eye
across the page.
Sorry this is a bit of a "do-it-yourself" exercise at present, but perhaps
the above will help you get close to what you want. TOC was not in the R1
plans because R1 reports tend to be small (no persistent storage). TOC will
become a higher priority once BIRT can create large persistent reports.
- Paul
Paul Rogers
BIRT PMC
"Mike Boyersmith" <mjboyers@us.ibm.com> wrote in message
news:d6t727$bmh$1@news.eclipse.org...
> Same Question..just left out a detail. looking for a way to add in the
> page numbers and elipses as well. such as
>
> 1. Book Name 'the Last Bastelope' .......................1
> 1.1 Book Overview .......................2
> 1.2 Book Details .......................2
> 2. Book Name 'Where the Wild Things Grow'.......................3
> 2.1 Book Overview .......................4
> 2.2 Book Details .......................4
>
>
> and even linking to the sections these would point to.
>
>
> Mike Boyersmith wrote:
>> Hello I'm trying to generate a table of contents to a row set of data.
>>
>> something like
>>
>> 1. Book Name 'the Last Bastelope'
>> 1.1 Book Overview
>> 1.2 Book Details
>> 2. Book Name 'Where the Wild Things Grow'
>> 2.1 Book Overview
>> 2.2 Book Details
>>
>>
>> Any idea how this would look
>>
>> say I have a row set taht repeats like
>>
>>
>> BookName, Book OverView, Book Details
>> ...,...,...
|
|
|
Powered by
FUDForum. Page generated in 0.08105 seconds