Skip to content

Instantly share code, notes, and snippets.

@o2b-ru
o2b-ru / bigdata_table.py
Last active January 16, 2024 06:17
BigDataTable faster LongTable on the big data (reportlab==3.5.23)
import reportlab
from reportlab import platypus
from reportlab.lib.utils import annotateException, IdentStr, flatten, isStr, asNative, strTypes
class BigDataTable(platypus.Table):
def _splitRows(self, availHeight):
n = self._getFirstPossibleSplitRowPosition(availHeight)
repeatRows = self.repeatRows
if n <= (repeatRows if isinstance(repeatRows, int) else (max(repeatRows) + 1)): return []