Page break on new group

45 views
Skip to first unread message

Tim Meneely

unread,
Aug 29, 2011, 9:30:19 PM8/29/11
to geraldo-users
Greetings,

This seems so obvious, but I can't get it to work and my searches have
failed.

I'm in django. I have a simple report, listing groups of children by
age group. I want each age group to start on a new page (so they can
be handed out to different teachers). The report prints beautifully,
but I don't get my page breaks.

I tried:
groups = [
ReportGroup(attribute_name = 'agegroup',
band_header = ReportBand(
height = 0.7*cm,
force_new_page = True,
elements = [
ObjectValue(attribute_name='agegroup', left=0,
top=0.1*cm, width=20*cm,
get_value=lambda instance: 'Age Group: ' +
(instance.agegroup.description),
style={'fontName': 'Helvetica-Bold',
'fontSize': 11})
],
borders = {'bottom': True}
)
),
]


with no break. Then I split the ReportBand out to a separate band and
tried:


class band_group_header(ReportBand):
height = 0.2*inch
force_new_page = True
elements = [
ObjectValue(attribute_name='agegroup', left=0, top=0.1*cm,
width=20*cm,
get_value=lambda instance: 'Age Group: ' +
(instance.agegroup.description),
style={'fontName': 'Helvetica-Bold', 'fontSize': 11})
]
borders = {'bottom': True}


groups = [
ReportGroup(attribute_name = 'agegroup',
band_header = band_group_header
),
]

Still no good - report prints, but just continuously on one page.

Help?

Thanks!
Tim Meneely,
Pittsburgh PA USA
Reply all
Reply to author
Forward
0 new messages