[reportlab-users] Layout problem while using KeepTogether flowable

476 views
Skip to first unread message

Javier Amor García

unread,
Aug 20, 2010, 2:29:40 AM8/20/10
to reportl...@lists2.reportlab.com
Hello,
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:

-------------
File
"/usr/share/ebox-services/control-panel/remote_services/services/report/eboxdoctemplate.py",
line 210, in extended_build
self.multiBuild(flowables, canvasmaker=canvasmaker)
File
"/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py",
line 955, in multiBuild
self.build(tempStory, **buildKwds)
File
"/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py",
line 877, in build
self.handle_flowable(flowables)
File
"/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py",
line 793, in handle_flowable
raise LayoutError(ident)
reportlab.platypus.doctemplate.LayoutError: Flowable <Table@0x0A20184C 3
rows x 1 cols> with cell(0,0) containing
"<Table@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'
----------------------

This is a error on my code or I am hitting a bug?.

Thanks for you time,
Javier
_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users

Matt Folwell

unread,
Aug 20, 2010, 5:49:09 AM8/20/10
to reportlab-users
On 20/08/2010 07:29, Javier Amor García wrote:
> Hello,
> 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@0x0A20184C 3
> rows x 1 cols> with cell(0,0) containing
> "<Table@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.

Regards,
Matt

Reply all
Reply to author
Forward
0 new messages