Report continues to next page - count available lines

G

Guest

I have a report with two sub-reports in it. Labor and Expense.
These sub-reports are of varying length. I don't want the Expense section to
be broken up onto the next page if it only has the subtotal line left to
print. I have grouped them so they "stay together", but that doesn't require
the Subtotal row to stay with the expense section of the report.

My thought is that these rows have to be somehow counted so that I know how
many lines are required for each subreport as well as their accompanying
total lines (max. of 2) and then determine if there is space left on the page
(after the report header and then only the page header on subsequent pages)
to print all the lines. The result is that it would decide if there is room
for all of these lines and print them together, or go back to the top of the
Expense section (page break) and print that portion together on the next page
in it's entirety -- including the subtotal lines.

Botttom line is: We don't want the Subtotal and Total lines to widow onto
the next page. We'd rather have the entire Expense section break off and go
with the total lines on the 2nd page leaving the Labor section and it's
Subtotal alone on the first page.

Thanks in advance for your advice!
 
M

Marshall Barton

Cydney said:
I have a report with two sub-reports in it. Labor and Expense.
These sub-reports are of varying length. I don't want the Expense section to
be broken up onto the next page if it only has the subtotal line left to
print. I have grouped them so they "stay together", but that doesn't require
the Subtotal row to stay with the expense section of the report.

My thought is that these rows have to be somehow counted so that I know how
many lines are required for each subreport as well as their accompanying
total lines (max. of 2) and then determine if there is space left on the page
(after the report header and then only the page header on subsequent pages)
to print all the lines. The result is that it would decide if there is room
for all of these lines and print them together, or go back to the top of the
Expense section (page break) and print that portion together on the next page
in it's entirety -- including the subtotal lines.

Botttom line is: We don't want the Subtotal and Total lines to widow onto
the next page. We'd rather have the entire Expense section break off and go
with the total lines on the 2nd page leaving the Labor section and it's
Subtotal alone on the first page.


What you want is the KeepTogether property. Unfortunately,
that is only available for sections and groups. If you add
a group to your main report based on a constant expression
such as =1 and specify that you want the group header and
footer sections, then you can move the subreports to their
own section where you can specify the KeepTogether property.

Note, if the subreport's were in the detail section, then
group on the detail data's primary key field instead of =1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top