Skip to content

Commit

Permalink
Fixed ReportGroup.force_new_page when works with child bands (with se…
Browse files Browse the repository at this point in the history
…condary detail pages)
  • Loading branch information
marinho committed Sep 23, 2010
1 parent 6219ea1 commit 7fd7ba7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2010-09-23: Version 0.4.10-stable
--------------------------------
* Fixed ReportGroup.force_new_page when works with child bands (with secondary detail pages)

2010-09-23: Version 0.4.9-stable
--------------------------------
* Fixed a test related to ReportGroup.force_new_page
Expand Down
2 changes: 1 addition & 1 deletion geraldo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
- tests - a package with automated doc tests.
"""

VERSION = (0, 4, 9, 'stable')
VERSION = (0, 4, 10, 'stable')

def get_version():
return '%d.%d.%d-%s'%VERSION
Expand Down
11 changes: 4 additions & 7 deletions geraldo/generators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ def render_band(self, band, top_position=None, left_position=None,
if not child_band.visible:
continue

self.in_tests = True # XXX
self.force_blank_page_by_height(self.calculate_size(child_band.height))

self.render_band(child_band)
Expand All @@ -417,15 +418,11 @@ def force_blank_page_by_height(self, height):
def append_new_page(self):
self._rendered_pages.append(ReportPage())

def force_new_page(self, insert_new_page=True):
def force_new_page(self):
"""Starts a new blank page"""
# Ends the current page
self._current_top_position = 0

# Creates the new page
if insert_new_page:
self.append_new_page()

# Starts a new one
self.start_new_page()

Expand Down Expand Up @@ -768,7 +765,7 @@ def render_groups_headers(self, first_object_on_page=False):
# Forces a new page if this group is defined to do it
if not new_page and group.force_new_page and self._current_object_index > 0 and not first_object_on_page:
self.render_page_footer()
self.force_new_page(insert_new_page=False)
self.force_new_page()

# Renders the group header band
if group.band_header and group.band_header.visible:
Expand Down Expand Up @@ -835,7 +832,7 @@ def force_new_page(height):
# Forces new page if there is no available space
if self.get_available_height() < self.calculate_size(height):
self.render_page_footer()
self.force_new_page(insert_new_page=False)
self.force_new_page()

for subreport in self.report.subreports:
# Subreports must have detail band
Expand Down

0 comments on commit 7fd7ba7

Please sign in to comment.