Created
May 15, 2013 06:23
-
-
Save marinho/5581982 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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