[reportlab-users] NextPageTemplate question

Andy Robinson reportlab-users@reportlab.com
Mon, 19 May 2003 14:31:25 +0100

> Why would do my page templates lag behind after the itinerary page?  Or, 
> rather, why would pg 2 not take the NextPageTemplate directive and apply 
> the statement template?

My guess is that insertItinerary is either filling the page, or
is inserting a page break at the end.  So, the engine has
already flipped over to page 2, still thinking the template
to use is the Itinerary.

NextPageTemplate literally means "use this the next
time you see a page break".  You need to set it before
changing pages.  So, if I am doing a letter with a
'covertemplate' and 'bodyTemplate', I usually puy
my NextPageTemplate action pretty near the top
of page 1.

It has to be this way as the templates can draw stuff
before any content is laid down, as well as after.  We did 
discuss, but never implemented, something to "peek ahead"
so that if the first thing on a page was a NextPageTemplate
it would still work.

Hope ths helps,

Andy Robinson

> 	def _makeStory(self):
> 		""" make story composed of sections """
> 		story = []
> 		story += [NextPageTemplate('Itinerary')]
> 		story += self._insertItinerary()
> 		story += [NextPageTemplate('Statement')]
> 		story += self._insertStatement()
> 		story += [NextPageTemplate('Segment')]
> 		story += self._insertSegments()
> 		return story
> Thanks in advance.
> -- 
> Chad Nantais
> Web Development Consultant
> Rednaxel Interactive
> cnantais@rednaxel.com
> http://cnantais.rednaxel.com
> _______________________________________________
> reportlab-users mailing list
> reportlab-users@reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users