<div dir="ltr"><div>Hi there,</div><div><br></div><div>I'd like to draw attention to a bug in within-row table splits.</div><div><br></div><div>Note: this one was first reported in 2024 by Christian Zwicknagl in the Google mirror of this mailing list (<a href="https://groups.google.com/g/reportlab-users/c/NhklESoh3mg/m/pO8Ve7VlCgAJ">link</a>). 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!)</div><div><br></div><div>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 <i>invalid</i> split case.</div><div><br></div><div>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.</div><div><br></div><div>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:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>reportlab.platypus.doctemplate.LayoutError: Flowable <Table@0x1067B9450 1 rows x 1 cols(tallest row 702)> with cell(0,0) containing</div><div>'<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'</div></blockquote><div><br></div>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 <i>some</i> flowable fits in the first half of the split, we simply postpone everything else.<div><br></div><div>I've confirmed that with this patch, the example code succeeds. I've also confirmed that all existing tests pass with this change applied.</div><div><br></div><div>Best regards,</div><div>Yosh</div><div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b style="color:rgb(34,34,34)">Yoshua Wakeham<br></b><br style="color:rgb(34,34,34)"><span style="color:rgb(34,34,34)">Senior Software Developer</span><br style="color:rgb(34,34,34)"><span style="color:rgb(34,34,34)">yosh@atticus.tech</span><br></div></div></div></div>