[reportlab-users] How to wrap text in a column in a table?

1 view
Skip to first unread message

Michael Rowan

unread,
Nov 25, 2009, 6:05:07 PM11/25/09
to reportl...@lists2.reportlab.com
Repeat enquiry - no bites last time.

Using Django and ReportLab. I am using the SimpleDocTemplate to
generate a number of reports. All is well, except that in all the
reports there is a column of text data that is capable of being too
long for the cell width. I need therefore to make that column wrap
whenever necessary.

My current table styling is taken straight out of the docs:
ts = [('ALIGN', (0,0), (-1,-1), 'LEFT'),
('LINEABOVE', (0,0), (-1,0), 1, colors.purple),
('LINEBELOW', (0,-1), (-1,-1), 1, colors.purple),
('FONT', (0,0), (-1,-1), 'Times-Bold')]

table = Table(data, 1*[0.75*inch]+1*[6.0*inch], style=ts)
elements.append(table)


I assume there is a blindingly obviously way to cause this, but I
haven't seen it yet. Can anyone tell me how to do it?

TIA

Michael Rowan
mike....@internode.on.net

11 Kingscote Street
ALBERTON
South Australia 5014

tel 618 8240 3993

_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users

Kevin D Smith

unread,
Nov 25, 2009, 6:12:45 PM11/25/09
to For users of Reportlab open source software, Michael Rowan
If you used Paragraph instances rather than strings/numbers for you
data in the table, I believe it will do what you want.

Kevin D Smith
Kevin...@sixquickrun.com

Reply all
Reply to author
Forward
0 new messages