[reportlab-users] Table content consist of single character

Tim Roberts timr at probo.com
Mon Aug 22 16:53:07 EDT 2011


Asif Jamadar wrote:

>

> fields = ('company_name')

>


That is not a one-element tuple. That is a string. This is one of the
(relatively few) warts in Python syntax. You want this:
fields = ('company_name',)



> charges_table = Table([fields] + charges)

>

> ...

> document.append(charges_table)

>

>

>

> The above code giving the output as follows

>

>

>

> C

>

> r

>

> n

>


Right. The table content is expected to be an iterable of iterables.
Yours happens to be that, but the inner iterables are strings (which
iterate one character at a time) instead of tuples containing a string.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20110822/6d4302e3/attachment.html>


More information about the reportlab-users mailing list