[reportlab-users] Re: Large tables - exponentially increasing run times

Henning von Bargen reportlab-users@reportlab.com
Wed, 19 May 2004 10:39:24 +0200

Just an idea:
When splitting a Table,
perhaps one could re-use the existing data
by adding two arguments skipRows (default: 0) and maxRows (default: None).

Existing algorithm:
When splitting a table T before row n:
create two new tables T0 with data[:n] and T1 with data[n:]

Possible new algorithm:
When splitting a Table T (skipRows, maxRows) before row n (+skipRows),
create two new tables
T0 with (data, skipRows,maxRows=n)
and T1 with (data, skipRows+n,maxRows=None).

When rendering a table T (skipRows,maxRows):
Begin rendering with row # skipRows
if maxRows: stop rendering before row skipRows+maxRows.

This at least saves memory for the shallow copies of data needed by
the existing algorithm, with a total size of approx.
numPages * len(data) (see Robin's computation).

For header rows (repeatRows)
and footer rows (not supported, but perhaps this is what Ulrich Wisser
the algorithm would have to be adapted.
I think that footer rows could easily be supported iff they have fixed