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

Andy Robinson reportlab-users@reportlab.com
Thu, 12 Sep 2002 11:12:40 +0100

> So what we need is an automatic computation of the row height needed.
Just omit the rowHeights argument when you initialize the table.
It then does it automatically.
It can even do the widths automatically, but the algorithm
is harder and takes longer.

> Also, is it possible to use rowspan and colspan like in HTML?
No.  That requires a much more complex drawing algorithm
and probably a new HTMLTable class, which we have not written.
It directly contradits with the design goials of the present
model which is (a) a really easy way to specify lines and
formatting when you don't know the number of rows and columns
and (b) drawing those lines all in one go instead of computing
every edge of every cell.

> It would also be great if one could compute the optimal width and height
> at least for paragraphs and use this height or width for a table 
> definition.
Give a paragraph a width and it works out its height.  What
would you suggest as the "optimal width" for a paragraph?  
I may have misunderstood the context.

One other tip for database reports.  Don't make a 1000-row
table and ask Platypus to split it.  This involves a lot of
extra computation as it works out the size of the whol thing,
then does it again for the 950-line table on page 2, the 900-line
table on page 3 and so on.  Instead, make each row or record group
(if there is a suitable grouping level) a separate table, and
put them in the story.  Then the splitting is trivial and it
goes a lot faster.

Hope this helps,

- Andy