[reportlab-users] Dynamic information in headers/footers

Eric Hochmeister erichochmeister at gmail.com
Wed Feb 9 18:47:37 EST 2005


Hi,

I was wondering how I can include dynamic information in the headers or footers.

I would like to include a person's name in the Header / Footer as long
as the page is displaying information pertaining to this person.  From
what I have read, you need to supply the page templates prior to
building the document.  This seems to be understandable and I thought
I would include a variable which contains the people's names in the
Header in a drawString command.  The issue occurs when I'm using
flowables.   I am sending an explicit PageBreak() at which point I'm
done printing info for the current person and I'm about to start
printing info for the next person.  I do not know how to change the
value of the variable in this situation and therefore the first
person's name is displayed on all pages.

How can I resolve this issue?

ie.

Page 1 -- Info on Eric, and header displays "Eric's Info"
Page 2 -- Notes for Eric, Page Break, set personName = John
Page 3 -- Info on John   and Header displays "John's Info"
Page 4 -- Notes for John, Page Break, set personName = Nina
Page 5 -- Info on Nina, and header displays "Nina's Info"
Page 6 -- etc...

Any ideas would be greatly appreciated!

Thanks!

Eric


More information about the reportlab-users mailing list