[reportlab-users] LayoutError - table doesn't fit on a page

Robin Becker robin at reportlab.com
Thu Feb 17 12:09:09 EST 2011


On 17/02/2011 16:58, Aljoša Mohorović wrote:

> On Thu, Feb 17, 2011 at 5:51 PM, Robin Becker<robin at reportlab.com> wrote:

>> It appears that your Image is too large to fit on a page so no matter what

>> the table tries to do you'll get problems with the framework objecting that

>> it cannot split etc etc. Currently the cowardly Table class refuses to

>> split cells so it won't do that. You could try setting some reasonable sizes

>> in the Image creation.

>

> i have 3 images, 300x300:

> img.drawWidth = 300

> img.drawHeight = 300 # also tried proportional, same result

>

> i'm just looking for a way to tell doc/table to expand on next page if

> content inside a table cell has larger height than page/doc/frame

> height.

>

> Aljosa

>

your earlier example said


> Exception Type: LayoutError

> Exception Value:

> Flowable <Table at 0x01F609E0 1 rows x 2 cols> with cell(0,0) containing

> '<Image at 0x27680e0 filename=<File:

> /home/aljosa/Projects/Sites/gin/media/photologue/photos/10.jpg>>'(583.275590551

> x 906) too large on page 2 in frame 'normal'(583.275590551 x

> 829.88976378*) of template 'Later'

> Exception Location: /home/aljosa/Projects/Sites/gin/env/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py

> in handle_flowable, line 793


ie the image is taller than a page. The Table refuses to split cells (or rows
for that matter). It will split at row boundaries. You don't need to tell tables
to do that, however, if any row is too tall it won't work.
--
Robin Becker


More information about the reportlab-users mailing list