Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Headers and page breaks prior to details

Status
Not open for further replies.

bmarks

IS-IT--Management
Sep 25, 2001
85
CA
I have a problem that in some of our reports, we end with a group that occasionally will page break after the group header and before the first detail section. We want to eliminate this group header from printing at the bottom of the page, either by suppressing it or moving the page break to before the group header. The scenario happens in quite a few reports.

If there is at least one detail record that will print on the same page, then we want it to print on that page and then repeat the group header on the next page with the next detail records.

I have done a search on this and found some other postings on how to solve this, but they don't quite fit my needs.

Now for why the other posted solutions don't work:
1. the "keep together" goup option - if there is at least one detail record that will print on that page, then we don't want to page break before the header.

2. The "put the first detail record in the group header" option - does not work for us as we need to repeat the group header on every page

3. The "line count" and page break if the line count gets above a certain value - this does not work for us as with all the subreports, can grow sections, logos and graphics in our reports, there is not reliable way to keep track of the number of lines that have actually been used.

I keep thinking there must be an easy and elegant way to do this and that it must be more common than it seems.

B.
 
The requirement is common, however the solution for your requirements is not.

Since the page varies as a result of the subreport, and the method supplied by Crystal (changing the group and selecting keep together) doesn't satisfy you requirements, I can't think of a reliable means.

Solution 2 might be tricked by adding BOTH the group header and the first row in a formula, and suppressing the first row AFTER a group, but it's sorta kldugy and may create other issues.

So the formulas in the group header would be:

if previous({table.group}) <> {table.group} then
{table.groupfield} & chr(13) & {table.field2}

if previous({table.group}) <> {table.group} then
chr(13) & {table.field2}

Then in the details useasuppression of:

previous({table.group}) <> {table.group}

So it will skip the first row of each new group in the details, and the group header will always supply the first row.

This may cause a new set of problems to work around though wherein you need to keep track of the pagenumbers too...

-k
 
Thanks, I see how that might work (and quite inventive), but I do see some potential issues as well.

I'll have to look at the reports, but it does concern me as our detail sections often have multiple lines and quite a few formulas. I'm not sure if I could get all those to work correctly if they are placed in the header.
 
Another approach would be to use option #2 above and insert a second group header section. In one section add the detail fields, and in the other don't. Then suppress the one containing the detail fields using a formula like:

inrepeatedgroupheader

Suppress the other one:

not inrepeatedgroupheader

-LB
 
LB, thanks for the suggestion. That might work. I don't really want to put the details in a group header if I can avoid it. I think I forgot to mention (I had meant to) that in some of the reports there are lots of calculated fields and complex formulas. I think some of them might not work correctly if they are not in the details section.

When I think about it, it seems like such a basic need and is so similar to the need to have group headers repeated on every page or keeping a group together, that it now suprises me that it's not a basic built in function.

Oh well, I'll keep trying out suggestions until something fits the bill.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top