[reportlab-users] Platypus PageTemplates & Frame selection

Scott SA pydev at rscorp.ab.ca
Sat Feb 24 23:44:07 EST 2007


Hi,

I'm _very_ new to ReportLab and still learning Python. However, I've spent
quite a bit of time time going over the documentation, examples and even the
source.

I think my problem is I'm approaching things from the wrong tangent as I'm
accustomed (from prev. experience) to explicitly specifying what & where I want
things to go.

I'll get to the point. I've sucessfully created DoumentTemplates and sets of
frames, all that I'm pretty sure is on-track.

Where I'm running into trouble is I have two page templates each with approx.
nine frames each. I've given them different id's (page & frames). For arguments
sake 'template_1' and 'template_2', with 'Frame_1' etc.

I'm trying to explicitly flow some text into, for example, 'Frame_1' after
choosing 'template_2'. Then flow a different batch of text into the next frame.

I think I have now, after pouring through source code, etc., figured out that
it is a kind of stack oriented process. I wanted to confirm this before I
wasted a bunch of time.

Is it the case that platypus is expecting the page template to be chosen by
appending "NextPageTemplate('<page_id>'" then selecting the frame by
handle_nextFrame('<frame_id>')"?

If so, that's cool. If not, then how?



The other problem I have is with this part of the docs for doctemplate.py:

"A document is built when a DocumentTemplate is fed a sequence of Flowables.
The action of the build consumes the flowables in order and places them onto
frames on pages as space allows. When a frame runs out of space the next frame
of the page is used."

If I have a sequence of frames that I _don't_ want to be automatically
populated, will I have to overshadow that functionality somehow or is there a
bit-o-magic I'm missing here?

Just a thought, but if I were to have a page template that had three frames I
wanted to have text flow across (automagically - technical description for
sure!), then swapped to a different template for the frames I didn't want to
the flow functionality to occur (then be sure to not give too much content).
Would this be the way to solve the problem at hand?


Thanks, in advance, for any assistance in figuring this out,

Scott


More information about the reportlab-users mailing list