Re: Patch to support tables with oversize cells
Lennart Regebro via reportlab-users <[email protected]> Tue, 19 Apr 2022 14:37:03 +0200
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Message-ID | <CAHT-kBfmR6LySSqD0HCoASsu=BrkJC5J_MoQx4GN43--O11m2A@mail.gmail.com> |
On Tue, Apr 19, 2022 at 11:45 AM Robin Becker <[email protected]> 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