AW: AW: [reportlab-users] setting Style for a Sum in a Table

Robin Becker reportlab-users@reportlab.com
Fri, 18 Oct 2002 14:08:59 +0100


In article <FDEJJKLBELAKNCMDIADEEEOHCCAA.Jo-Bader@gmx.de>, Jo-
Bader@gmx.de writes
>
>
>its seams to work when setting to the amount of rows -1 .
>but i am not sure
>
># setting Style of the last row in a splitted table on the latest page
>self.tStyle.add('BACKGROUND', (0 ,nDataRows-1), ( -1, nDataRows-1),
>colors.darkgray)
>
># setting Style of the last row in a splitted table on each page
>self.tStyle.add('BACKGROUND', (0 ,         -1), ( -1,          -1),
>colors.darkgray)
>
>
>
>regards
>
>Jo
......yes that works because nDataRows-1 is a positive number so we only
set for the exact row. The -1 form is a relative last and when we copy
the styles during a split we're not being clever enough to distinguish
between what people mean ie repeat the style on every partial table so
if your 80 line table is split into

        0-19, 20-39, 40-59, 60-79

then I think the -1, style is being applied on rows 19, 39, 59 and 79
and probably we could be clever and split the styles better.
-- 
Robin Becker