[reportlab-users] Problem with row&column spanning code not calculating table heights

Robin Becker reportlab-users@reportlab.com
Thu, 16 Oct 2003 09:01:29 +0100


In article <LKENLBBMDHMKBECHIAIAIEHGEBAA.andy@reportlab.com>, Andy
Robinson <andy@reportlab.com> writes
>> formulation. In algorithmic terms LP is considered easy so perhaps I was
>> talking "super easy" :)
>
>Ah yes.  I am an intellectual lightweight and happy to remain
>that way :-)
>
>Seriously, a generic approach to layout constraint
>solving would be very interesting; I wonder if we
>could unify the problems of table layout, page
>layout, and shuffling around chart elements into
>suitable places, so that one generic constraint
>system could solve the lot?  If anyone in our user
>group is looking for PhD thesis ideas I reckon
>that's a good one...
>
>- Andy
> 
I think the Knuth approach with dynamic programming algorithms are
applicable to most of the layout problems. However, they do assume that
the size of boxes/elements are known. The actual sizes of spanning
columns/rows etc etc is complicated by the trade-off between width and
height for cells containing paragraphs etc.

As for constraints there is an existing java/c++ constraint system that
has been used for layout called cassowary. Seems pretty fast to me and
could probably be used for charts and the like, but I think it would be
hard to do general textual layout with it.
-- 
Robin Becker