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

Robin Becker robin at reportlab.com
Wed Feb 23 05:51:12 EST 2022


Hi Lennart,

thanks again for the effort there's good and bad news.

Good
  1) the default setting splitInRow=0 doesn't seem to make any changes to the many rendered PDF's we compare for
     unexpected changes.

  2) the simple splits seem to work OK with either simple string or flowable list cell content.

Bad
  1) the split return wrongly adjusts the styling of the second part of the split. You can see this
     in the example here https://www.reportlab.com/ftp/lennart/lennart-example2-1-1-36.pdf
     which was made using https://www.reportlab.com/ftp/lennart/lennart-example2.py
     ie python lennart-example2.py --splitInRow=1 --split=36
     We have quite a bit of code that adjusts part 2 style definitions on the assumption that
     the split happens at a row boundary. I see that you tried to adjust eg
         if (sr<n and er>=n) or (doInRowSplit and sr==n):
     but the example shows it didn't work/is not applied for some cases.

  2) The cell split seems to have no lower limit. In most cases we would not want to leave a very small part of a table 

     at the end of a page so presumable we would only want to split a row if it exceeds a specific height. That would
     normally be the height of a frame or page. My guess is we could adjust this patch to use the value of splitInRow as
     a suitable lower limit on row height for splitting. I think there are really two kinds of issue here ie when a row
     should split and where in the row should the split happen.

Untested
   1) I guess this has not been tested at all with spanned rows/columns, but I haven't tried as yet.

   2) I haven't tried very long cells that would require two or more splits.

   3) I haven't checked to see if vertical alignment makes any real difference in split cells, but I think your
      added test does show that it seems to do the right thing.

If we can fix these it will be a big step forward even if the spanned cases don't work.


On 21/02/2022 15:14, Lennart Regebro wrote:
> OK, I solved that problem, indeed, space got incorrectly added after the
> split.
> 
> I also changed the default to not split in rows, as you preferred.
> 
.......
-- 
Robin Becker


More information about the reportlab-users mailing list