[reportlab-users] Re: Using report lab for generating

Andy Robinson reportlab-users@reportlab.com
Sat, 14 Sep 2002 09:06:25 +0100

> Thanks for the suggestion Andy. I have gone back to
> fix a few table documents to use your suggested
> method. However, now that each row is its own table,
> the rows don't line up. For example:
> |*****|*****|*********|
> |***|*****|*******|
> |*****|***|*********|
When you initialize the table, always set the colWidths 
argument, but leave the rowHeights as None.  e.g. 
  t = Table(data, colWidths=[100,100,75,75,200))

For most projects you should do this anyway, as you
should decide the sane width for a column of numbers
to make sure the largest possible number just fits.
If you don't bother to set rowHeights, it will set
the height of each row to 'just fit' which is almost
always what you want.

This is covered in chapter 7 of the User Guide
(reportlab/docs/userguide.pdf, or run 
reportlab/docs/userguide/genuserguide.py if
you have a CVS copy).

- Andy