[reportlab-users] 'Plane' object in the works (was Re: Problem with row&column spanning ...)

Rasjid Wilcox reportlab-users@reportlab.com
Fri, 17 Oct 2003 00:25:09 +1000


On Thursday 16 October 2003 22:56, Marc Stober wrote:
> Sometimes I wonder if tables would be better approached as two separate
> objects, one for tables of figures, and the other for use as a layout grid
> (this applies to HTML even more than ReportLab).

I wasn't going to mention this until I had everything working and a number of 
good working examples, but the I'm building a module that seems relevant to 
this discussion.

I recently downloaded reportlab and thought it was fantastic.  I read through 
the users guide (got some comments and some typo's if you want them) and read 
up on tables, but they really did not have the flexability that I wanted.

My primary aim is to have a cross-platform database reporting tool, at least 
as powerful as Crystal Reports (although I'm happy to create reports with 
'code' the report rather than create them with a Gui).

Technically, reportlab is already capable of doing this, but I wanted a system 
that makes things a bit simpler, particularly for reports that are more than 
one page wide.  I particularly wanted something that can dynamically adjust 
the layout for a change in font size or page size.

What I have writtem so far is a 'Plane' object.  Think infinite cartesian 
plane, where you specify all points in absolute terms.  ie, draw a line from 
(0,0) to (1000,1000), or place a text box at (50, -1250).  The 'Plane' is 
divided into 'Partitions' (for which you define the width and height), and 
once you have finished placing items on the Plane, you can extract a sequence 
of Partition flowables, which are then ready to be drawn onto the canvas in 
the usual way.  Basically it provides an extra level of abstraction between 
the co-ordinate system and the 'physical' page.

Almost as an aside, the Plane object can define a bleed amount for each 
partition, and this can be used to make large posters that span several pages 
where you have some overlap to make sticking them together easier.  You just 
draw your figure within the co-ordinates (10, 10) to (1100, 830), and the 
Plane object looks after the rest. [Note: you can only place Flowables into a 
Plane - are there standard Flowables for all the raw draw operations?  I 
couldn't see them, but then I haven't read through all the reportlab code 
yet.  ;-) ]

I'm currently in the middle of writing an 'AnchorLine' class that will be used 
to do at least some of the layout management for items going onto a Plane 
(well, at least for 'database report' like things anyway).  The 'raw' Plane 
object already works, and I expect to have the AnchorLine and maybe some 
other basic layout objects working within a day or two.  If people are keen I 
can post the code as its stands now, although I'd rather wait until I've had 
a bit of a chance finish the basics and do some interesting things with it.

I guess the point of this post is that if people are looking for something a 
bit more flexible than tables, I will have the initial version of 'something' 
in a few days.

Cheers,

Rasjid.

PS.  What is the deal with copyright/licensing of things contributed to 
reportlab?  In particular, for something to eventually make its way into the 
core reportlab libraries, does one need to assign copyright over to ReportLab 
Inc, or simply release it under the same style of license as reportlab?

PPS.  How is that 'community area' coming along??

-- 
Rasjid Wilcox
Canberra, Australia (UTC +10 hrs)
http://www.openminddev.net