[reportlab-users] table header
William Dode
reportlab-users@reportlab.com
12 Oct 2002 19:09:19 +0200
Robin Becker <robin@reportlab.com> writes:
> In article <878z14gcpq.fsf@flibuste.net>, William Dode <wilk-
> ml@flibuste.net> writes
> ......
> >
> >for the page header, i used onPage=myheader
> >but on myheader i don't know which row is curently print in the current
> >page...
> >
> >shall i use a different pagetemplate for each break ? but i will need to
> >break the page each time...
> >
> >thanks
> >
> An easy way to do this is to have a draw time variable that's altered by
> the things that you draw.
>
>
> so something like
>
> from reportlab.platypus import Macro
> dtInfo = None
> class myMacro(Macro):
> def __init__(self,info):
> self.command = 'dtInfo=%s' % repr(info)
> self.info = info
> def draw(self):
> global dtInfo
> dtInfo = self.info
> #test
> m=myMacro('aaaaaaa')
> m.canv = None
> print dtInfo
> m.draw()
> print dtInfo
>
> You can then add these to your story and use one or other of the page
> hooks to do something with it.
i'll study that, i also find a solution with multiple pageTemplate.
thanks, really great tools
--
William Dode - http://wikipython.tuxfamily.org