[reportlab-users] Table and Paragraph

Aitzol Naberan Burgaņa reportlab-users@reportlab.com
Thu, 15 Jul 2004 11:48:33 +0200

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
<tt>Hi all,<br>
I'm new using reportlab and I have some troubles with tables. <br>
I want insert a pargraph into a table cell
(data.append([Paragraph(text,style),Paragraph(text1,style)]), two
colums one row table, I think)<br>
But when I try to build my pdf file I get this error:<br>
Traceback (most recent call last):<br>
&nbsp; File "taula.py", line 111, in ?<br>
&nbsp;&nbsp;&nbsp; go()<br>
&nbsp; File "taula.py", line 107, in go<br>
&nbsp;&nbsp;&nbsp; doc.build(getFlowables())<br>
&nbsp; File "/usr/lib/python2.3/reportlab/platypus/doctemplate.py", line
579, in build<br>
&nbsp;&nbsp;&nbsp; self.handle_flowable(flowables)<br>
&nbsp; File "/usr/lib/python2.3/reportlab/platypus/doctemplate.py", line
496, in handle_flowable<br>
&nbsp;&nbsp;&nbsp; if self.frame.add(f, self.canv, trySplit=self.allowSplitting):<br>
&nbsp; File "/usr/lib/python2.3/reportlab/platypus/frames.py", line 111, in
&nbsp;&nbsp;&nbsp; w, h = flowable.wrap(self._aW, h)<br>
&nbsp; File "/usr/lib/python2.3/reportlab/platypus/tables.py", line 451, in
&nbsp;&nbsp;&nbsp; self._calc()<br>
&nbsp; File "/usr/lib/python2.3/reportlab/platypus/tables.py", line 325, in
&nbsp;&nbsp;&nbsp; self._calc_height()<br>
&nbsp; File "/usr/lib/python2.3/reportlab/platypus/tables.py", line 296, in
&nbsp;&nbsp;&nbsp; raise ValueError, "Flowable %s in cell(%d,%d) can't have auto width
in\n%s" % (v[0].identity(30),i,j,self.identity(30))<br>
ValueError: Flowable &lt;Paragraph at 1079373196&gt;Isabel I.aren
(1558-163) eta J in cell(0,1) can't have auto width in<br>
&lt;Table at 1079373164 27 rows x 2 cols&gt; with cell(0,0) containing<br>
'&lt;Paragraph at 1079373196&gt;Isabel I.aren (1558-163) eta J'<br>
It seems something with the Paragraph width, but I don't know what. I
search the usermanual and reference guide for something to set the
paragraph width, but I don't see nothing.<br>
Any hint with this????<br>
<div class="moz-signature">-- <br>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<span style="font-family: courier new,courier,monospace;">Aitzol
Naberan Burga&ntilde;a<br>
<a href="mailto:anaberan@codesyntax.com">anaberan@codesyntax.com</a><br>
<a href="http://www.codesyntax.com">www.codesyntax.com</a><br>
</span>Tel: 943&nbsp; 82 17 80<br>