[reportlab-users] [Bug report] Table splits fail due to postponed-content height constraint

Yoshua Wakeham yosh at atticus.tech
Thu Nov 13 16:44:52 EST 2025


Hi there,

I'd like to draw attention to a bug in within-row table splits.

Note: this one was first reported in 2024 by Christian Zwicknagl in the
Google mirror of this mailing list (link
<https://groups.google.com/g/reportlab-users/c/NhklESoh3mg/m/pO8Ve7VlCgAJ>).
It seems that the report didn't get noticed, because it was only ever
posted to the mirror. I have adapted his test code and patch, but I don't
have his contact details so I haven't been able to communicate with him to
see if he would still be interested in a fix. (Christian, if you're out
there, thank you for reporting this in 2024!)

At present, table row splits will fail if the height of the "postponed"
content exceeds the height of the original row, minus the space available
for the "non-postponed" content. The problem is that this constraint seems
to cause perfectly-valid splits to fail – and doesn't (as far as I can see)
prevent any specific *invalid* split case.

While at first blush it might seem that the sum of the parts of a split row
should always equal the height of the original row, in fact splitting cells
usually introduces some amount of additional padding/space which "inflates"
the height of the row. As Christian reported, it seems that
cells containing many flowables can trigger this split failure fairly
easily.

I've attached a very small example that demonstrates the problem, by
splitting a cell containing just 38 small paragraphs. When run against
reportlab v4.4.4, it fails with a layout error:

reportlab.platypus.doctemplate.LayoutError: Flowable <Table at 0x1067B9450 1
rows x 1 cols(tallest row 702)> with cell(0,0) containing
'<Paragraph at 0x1067bebd0>'(200 x 702), tallest cell 702.0 points,  too
large on page 2 in frame 'normal'(439.27559055118115 x 685.8897637795277*)
of template 'Later'


I've attached a patch, adapted from Christian's similar patch, that removes
the height constraint on postponed content – rather, if we attempt to split
a flowable in the cell, then provided that *some* flowable fits in the
first half of the split, we simply postpone everything else.

I've confirmed that with this patch, the example code succeeds. I've also
confirmed that all existing tests pass with this change applied.

Best regards,
Yosh

-- 

*Yoshua Wakeham*
Senior Software Developer
yosh at atticus.tech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20251113/0b910eef/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: repro_split_postponed_content_height_bug.py
Type: text/x-python-script
Size: 355 bytes
Desc: not available
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20251113/0b910eef/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-remove-height-constraint-on-postponed-content.patch
Type: application/octet-stream
Size: 4325 bytes
Desc: not available
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20251113/0b910eef/attachment.obj>


More information about the reportlab-users mailing list