[reportlab-users] Setting Paragraphs as individual elements in a data table

Funke, Matt Matt.funke at vishaypg.com
Tue Apr 10 14:50:55 EDT 2012


I've populated matrices for a data table and a style table that I want to pass on to reportlab.platypus.tables.Table(). Here are the matrices as they currently exist:

headerStyleData:
[('BOX', (0, 0), (0, 2), 0.5, (0, 0, 0)),
('SPAN', (0, 0), (0, 2)),
('VALIGN', (0, 0), (1, 2), u'TOP'),
('ALIGN', (0, 0), (1, 2), u'CENTER')]

headerTableData:
[[[<reportlab.platypus.flowables.Image instance at 0x0325B580>], ''],
[[<reportlab.platypus.flowables.Image instance at 0x0325B580>], ''],
[[<reportlab.platypus.flowables.Image instance at 0x0325B580>], '']]

However, when I issue this command:

headerTableData[0][1] = 'd'

... and then look at the contents of headerTableData, I get this:

[[[<reportlab.platypus.flowables.Image instance at 0x0325B580>], 'd'],
[[<reportlab.platypus.flowables.Image instance at 0x0325B580>], 'd'],
[[<reportlab.platypus.flowables.Image instance at 0x0325B580>], 'd']]

Why is this? Shouldn't only the top-left corner of the matrix be set to 'd'? Is there a way I can keep from duplicating this data in every row in the column 1? (Does it have something to do with how I set SPAN in column 0?)

Thank you for your time and assistance.

Matt Funke
Programmer/Analyst
Vishay Precision Group, Inc.
951 Wendell Blvd
Wendell, NC 27591 USA
Office: 919-374-5553
Mobile: 919-628-9261
Fax: 919-374-5248



More information about the reportlab-users mailing list