Skip to content

Instantly share code, notes, and snippets.

@marinho
Created May 15, 2013 06:23
Show Gist options
  • Save marinho/5581982 to your computer and use it in GitHub Desktop.
Save marinho/5581982 to your computer and use it in GitHub Desktop.
"""
Example of Geraldo Reports printing content above page header
1st page:
------
| page header with content printed once
------
| child band with normal page header content
------
2nd and next pages:
------
------
| child band with normal page header content
------
"""
def report_new_page(report, page, generator):
# Try this way
report.band_page_header.visible = page > 1
# If above doesn't work
band_page_header.height = 1*cm if page > 1 else 0
for el in report.band_page_header.elements:
el.visible = page > 1
class MyReport(Report):
class band_page_header(ReportBand):
elements = [... elements printed once ...]
child_bands = [ReportBand(elements=[... elements printed always ...])]
on_new_page = report_new_page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment