[reportlab-users] multipage table
Timothy Smith
timothy at open-networks.net
Mon May 16 20:56:11 EDT 2005
sorry if this is obvious and covered in the docs, but i get the
following error when a table i make is larger then a single page
raise ValueError, "%s must have at least a row and column" %
self.identity() File
"/usr/local/lib/python2.3/site-packages/reportlab/platypus/tables.py",
line 192, in identity
cv = self._cellvalues
AttributeError: Table instance has no attribute '_cellvalues'
i make multipage pdf's in other parts of my app, so i'm a bit stumped as
to why i'm getting this error, i just assumed reportlab would split over
to a new page automaticly.
here is my code
doc = SimpleDocTemplate(PDFName)
Data = PaperWorkSQL.MakeReport(UserName,PassWord, ForVenue,
FromWeek, ToWeek, ReportType, Year)
Report = []
if ReportType == 'SecretShopper':
Items = Data[0]
Totals = Data[1]
ReportStyle = TableStyle([('ALIGN',(0,0), (-1,-1), 'CENTRE'),
('LEFTPADDING',(0,0),(-1,-1),4),
('RIGHTPADDING',(0,0),(-1,-1),4),
('FONT',(0,0),(-1,-1),'Times-Roman',8)])
# add headings
Totals.insert(0,['Week','Pass/Fail','Result','Possible','Passing'])
Items.insert(0,['Week','Category','Comment','Score'])
#items table
ItemsTable = Table(Items, None, None)
ItemsTable.setStyle(ReportStyle)
Report.append(ItemsTable)
#totals table
TotalsTable = Table(Totals, None, None)
TotalsTable.setStyle(ReportStyle)
Report.append(TotalsTable)
doc.build(Report)
More information about the reportlab-users
mailing list