[reportlab-users] Moving to next frame in Platypus

John Pywtorak jpywtora at calpoly.edu
Tue Jun 28 17:42:14 EDT 2005

Amit wrote:
> Thank you for the reply! You were rightk I did miss that.
>># define pageTemplates - for page in document
>>>mainPage = PageTemplate(frames=frameHeader)
>>It looks like you missed frameChart1 in the frames parameter. Ex.
>>frames=[frameHeader, frameChart1] I believe.
>>># define BasicDocTemplate - for document
>>>doc = BaseDocTemplate('report_1.pdf', pagesize=landscape(letter),
>>BaseDocTemplate should really be your subclass/superclass versus
>>instantiating it. 
> What do you mean by subclass/superclass? Any examples. I think I have an 
> idea of what you are talking about but if you could further elaborate, that 
> would be great.

# Here is an example, BaseDocTemplate is the superclass, or parent of
MyDocTemplate.  I also implement the _allSatisfied base class method.
Notice that my _allSatisfied calls the parents implementation.

class MyDocTemplate(BaseDocTemplate):
    _invalidInitArgs = ('pageTemplates',)

    def _allSatisfied(self):
        self._pass_num += 1
        print "Pass Number: %d" % self._pass_num

        if self._pass_num > 1:
            print "Page Count: %d" % self.num_pages
            return BaseDocTemplate._allSatisfied(self)

        return 0

Johnny P
Start Here
Frustrating Hanging Crashing
Blue Screen of Death

More information about the reportlab-users mailing list