[reportlab-users] Layout problem while using KeepTogether flowable
mjf at pearson.co.uk
Fri Aug 20 05:49:09 EDT 2010
On 20/08/2010 07:29, Javier Amor García wrote:
> I am using reportlab and is working fine except when I use the
> KepeTogether to group the hoistory's elements of my report sections.
> Then I usually, but not always, I get a Layout error.
> It is worth to note that when I am not using KeepTogether the code works
> flawlessly, here is the change I made to use KeepTogether (section_rows
> is a list when the story elements of the section):
> # return section_rows
> return [KeepTogether(section_rows)]
> This is the trace and the layout error I get:
> reportlab.platypus.doctemplate.LayoutError: Flowable <Table at 0x0A20184C 3
> rows x 1 cols> with cell(0,0) containing
> "<Table at 0x0A213A0C 1 rows x 1 cols> with cell(0,0)
> containing\n'<KeepTogether at 0xa213b0c> containing :<Paragraph at
> 0xa213'"(745.26 x 50331681) too large on page 4 in frame
> 'normal'(439.275590551 x 685.88976378*) of template 'Later'
You're putting your KeepTogether in a table, which doesn't work.
(Because the table needs not know how long each of its rows is, and the
KeepTogther lies about that to force a split.)
But there's no need for a KeepTogether there anyway, as Reportlab never
splits inside a table row.
More information about the reportlab-users