[reportlab-users] KeepTogether platypus Table

Robin Becker robin at reportlab.com
Tue Nov 28 13:57:41 EST 2006

dmiller wrote:

> I've implemented a simple extension to reportlab.platypus.Table

> (ReportLab 2.0) that supports a KEEPTOGETHER command. The command

> prevents page breaks within a given group of rows. It would be great if

> this could be merged into the main platypus distribution (I'd be willing

> to write a patch if there's interest). Note that this extension has not

> been tested very thoroughly (e.g. negative table indices have not been

> tested), so use at your own risk.


> The code is attached.


> ~ Daniel


I don't see anything particularly against the concept. I guess the main problem
is if it impacts badly on existing table code.

Certainly the split stuff is a bit flaky as the KEEPTOGETHER could move the
split back into the repeat rows and we'd need to check for that.

Double looping the commands is a cpu waste so if this could be merged in it
would be better.

I don't think I like the KEEPTOGETHER concept alone. It is really a split
inhibition and I think I might want to say that a split should not occur before
a specific row or after a specific row as well. In a KEEPTOGETHER group the
first doesn't want a split after and the remainder don't want splits before so
there are two more primitive properties of rows that could do the same thing.

I can't see the point of having an error/warning if start>=stop it just means
there's no possible split that could come between so dropping is OK.

Just mumbling
Robin Becker

More information about the reportlab-users mailing list