[reportlab-users] Table, SPAN and splitlast

rj-reportlab at arsynet.com rj-reportlab at arsynet.com
Tue Feb 19 12:38:28 EST 2008


le 19.02.2008 17:48 Robin Becker a écrit:

> Brandon Rich wrote:

>> Also, was there ever a resolution to this problem? I have run into the

>> same issue but have not found an answer to it

>>

>> Thanks

>>



>> When I first tried with ('SPAN', (0, 'splitlast'), (-1, 'splitlast')) it

>> was done after an example found in the distribution :

>> reportlab/test/test_platypus_tables.py

>> where you can find : ('LINEBELOW', (0,'splitlast'),

>> (-1,'splitlast'), 1, colors.white,'butt')

> ........

>

>

> yes well a line is not the same as a span. The problem here is that

> the splitlast row is always in the first table and the -1 element will

> always be in the second (assuming that a split occurs). If a split

> doesn't occur splitlast is not relevant if it does the span is

> impossible. I don't think we can do the determination of splitlast

> before the spans are calculated and making a span a function of

> splitlast is liable to cause some major headaches.

>

>

About a week ago, I got an answer that may not have arreived on the
list. So I quote it here :
le 13.02.2008 20:46 Paul Barrass a écrit:
> [Responding to a month-old post, but with hopefully something of use...]
>
> Hi,
>
> Regarding the spanning of the last row of each page when a table is
> split over multiple pages - It appears that, when negative row numbers
> are given they are stored differently for spans than for other styles
> (the row for a style is stored as the original negative for a span, but
> the actual line number for other styles) meaning that when a table is
> split the span information for negative rows is repeated on both
sub-tables.
>
> The workaround I have used is to add the line
>
> if sr<0 and c[0]=='SPAN': continue
>
> to the _cr_0(self,n,cmds) function in the Table class (or a class
> inheriting from Table).
>
> This is not the Right Thing to do, it will fail if the final spanned
> rows are not all on the final page - this will only happen if more than
> 1 row should be spanned.
>
> Paul Barrass.
> Safe Online Billing Limited
>
> [I'm not actually subscribed to the list, so please respond directly if
> you want me to see any responses]
>



More information about the reportlab-users mailing list