[reportlab-users] Patch to support tables with oversize cells
Lennart Regebro
lregebro at shoobx.com
Tue Apr 19 08:37:03 EDT 2022
On Tue, Apr 19, 2022 at 11:45 AM Robin Becker <robin at reportlab.com> wrote:
> python lennart-example.py --splitByRow=0 --splitInRow=1 --split=55
> --pdfn=ttt.pdf --useData=1
>
> this works and splits the column spanned row 3 (row=2 in python). The cell
> is split OK, but it gets styles from the
> splitfirst, splitlast styles. I'm not sure that's right for a split in the
> row when the split row is neither a first row
> or last.
Well, it becomes a last and a first row... So that behaviour was simply
what happened, and is the same as if it was splitByRow, so it made sense to
me to just keep it. But certainly it's possible to change so that the
lastrow and firstrow commands aren't applied in this case. I don't really
know what the usecase is for such styles, it seemed to me that they were
there to show that this was not the top or bottom of the table, but
continuations, and then it makes sense in this case as well, in my opinion.
But maybe the usecase is different?
> If I use
>
> python lennart-example.py --splitByRow=0 --splitInRow=1 --split=22
> --pdfn=ttt.pdf --useData=1
>
> then the split fails because it crosses the spanned row cell
>
Hmm, yes, it tries to split in the second row, fails because it's only one
line high, so it can't be split, and then falls back to splitByRow, which
it doesn't because of the span. So that's a specific edge case which I
could try to support if you want? But it's a mix of inside and inbetween
splits, so I would have to add special handling just for that. I think I
would have to, instead of failing in this case, check if there is any
spans, and in that case split only those, and then do a byRowSplit. It's
doable, but possibly opens up another can of worms.
//Lennart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20220419/f36575b8/attachment.htm>
More information about the reportlab-users
mailing list