[reportlab-users] Patch to support tables with oversize cells

Robin Becker robin at reportlab.com
Fri Jan 28 07:44:16 EST 2022


On 13/01/2022 13:24, Lennart Regebro wrote:
> On Thu, Jan 13, 2022 at 11:33 AM Robin Becker <robin at reportlab.com> wrote:
> 
>> Hi Lennart,
>>
>> I looked at this problem recently and concluded I didn't have enough
>> stamina to work through all the problems. If you
>> have then I congratulate you.
>>
> 
> It did take a long time. I *hope* I found and fixed all the problems.
> 
Hi Lennart,

I tried applying this patch and running through our usual comparison tests.

I see immediately that a downstream failure test fails (ie a pdf was produced when it should have errored out). We have 
tests in rml which can use a fairly complex backtrack to determine exactly which but of xml produced the error.

Looked in the patch and see that it defaults to splitInRow=1. I changed that to 0 and expected it would stop any change 
in behaviour. However, I am still seeing a success when I expect a failure.

I made a zip containing the differences I see in before and after pdf for the reportlab tests;  see

https://www.reportlab.com/ftp/lennart-oversize-cells-diffs-20220128-0.zip

for the page level differences. These were made with the default for splitInRow=0.

The rml file that should fail is

#######################################################
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<!DOCTYPE document SYSTEM "rml_1_0.dtd">
<!--expect:rowHeights='150cm'> (Table) @ 12:49 - 14:15-->
<document filename="test_054_blockTable_run_error.pdf">
	<template pageSize="(595, 842)" leftMargin="72" showBoundary="1">
		<pageTemplate id="main">
			<frame id="second" x1="35" y1="45" width="525" height="590"/>
		</pageTemplate>
	</template>
	<stylesheet/>
	<story>
		<blockTable colWidths="3cm" rowHeights="150cm">
			<tr><td/></tr>
		</blockTable>
	</story>
</document>
#######################################################

which is a row of height 150cm inside frame of height 590pts. It should fail with a layout error. I can probably 
recreate in simple reportlab, but as we have other unexpected differences in simple reportlab I guess those need 
correction first.
-- 
Robin Becker


More information about the reportlab-users mailing list