[reportlab-users] Tables: Page two more narrow than one (continued).
Vegard Munthe
reportlab-users@reportlab.com
Fri, 11 Apr 2003 09:43:40 +0200 (CEST)
I've seen a post on this subject 21st Jan, but it didn't get any
conclusive answer.
The problem arises with the Table flowable. When the table receives a
long data sequence reportlab reports a layouterror:
---
LayoutError:
Flowable <Table at 139202956 1331 rows x 5 cols> with cell(0,0) containing
'L\xf8nns#' too large on page 2
---
I'm guessing this is due to the collective columns not fitting the
defaultPageSize (testing showed the problem arises when certain long
column entries are present together, making the table wide, but not too
wide), and I was wondering if margins are set somewhere (couldn't find in
docs), or if I can force the table to be drawn.
Relevant code:
---
def create_sheet(filename, list, test=0):
doc = SimpleDocTemplate(filename)
style = styles["Normal"]
story = hardc.Story()
data = []
if len(list) > 0:
for object in list:
if data == []:
data.append(add_row(object,what="fieldname"))
data.append(add_row(object))
story += Table(data, colWidths=None, rowHeights=None,
splitByRow=1, repeatRows=1, repeatCols=0)
doc.build(story, onFirstPage=hardc.nkf_backdrop)
---
Any help is appreciated.
-- Vegard Munthe