[reportlab-users] Patch to support tables with oversize cells
Lennart Regebro
lregebro at shoobx.com
Tue Feb 1 11:34:41 EST 2022
OK, I got a small bit wrong in the logic of when to split in each way,
fixed now, new patch attached.
I guess rml should support a splitInRow attribute on tables as well, but I
can't figure out how that works. The only mention I can find of splitByRow
in rlextra is in the rml.dtd. If I add splitInRow there, the parser doesn't
complain, but it doesn't get passed to the table...
On Fri, Jan 28, 2022 at 1:44 PM Robin Becker <robin at reportlab.com> wrote:
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20220201/f495c6b2/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: splitInRow.diff
Type: text/x-patch
Size: 27948 bytes
Desc: not available
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20220201/f495c6b2/attachment-0001.bin>
More information about the reportlab-users
mailing list