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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Page Breaks with Multiple Groups

Status
Not open for further replies.

shelby55

Technical User
Jun 27, 2003
1,229
CA
Hi

I have a report with two groups: Group 1 is Company Name and Group 2 is Employees. There can be many employees grouped under each company. I don't want to produce a page per company but I want to avoid having a company name "orphaned" at the bottom of a page with the employees list starting on the following page. Selecting the group option of "keep together" only affects the group itself, not in relation to each other.

Please help - thanks!

Shelby
 
Perhaps you should create a formula that concatenates both, and use it as the inside group, that way you can use keep together.

Otherwise I think that keep together on either side might produce a group without any details, or the group will jump to the next page.

I'm getting tired though, someone may have a solution.

-k
 
Thanks for trying - now go nap! I'll try this but I'm not sure it will work. Anyone else?
 
If you select report->change group options->options->"keep group together" for the company group, it should keep the company group header with the employee groups on the next page, since the company group surrounds the employee groups.

If this doesn't work for whatever reason, you could add the group 1 header fields into the group 2 header and then conditionally suppress it so it only appears once per instance. To do this, create a running total {#cntgrps} using the running total editor:

Select {table.company}, count, evaluate on change of Group 2 (Employees), reset on change of Group 1 (Company). Then select the group 1 header field(s) that you have placed in the group 2 header, right click and choose format field->suppress->x+2 and enter:

{#cntgrps} <> 1

You could, if you wanted, put the Group 1 header in a separate Group 2a section, with the regular Group 2 fields in a Group 2b section. You could then use the above formula to suppress the Group 2a section by going to format section. If you do this, be sure to go to format section->group 2 header and check &quot;keep together&quot; for all three group 2 header sections--the higher order group 2 header, as well as group 2a and group 2b headers.

That should do it.

-LB
 
Hi

I'm trying to figure out your suggestion but I don't thing it's going to work because I have the report set up so that it shows totals of various items like sales etc. per company and also per employee in the secondary group. Or can I?

Shelby
 
Good point. The employee totals in the second group would be fine, but the company ones, if dragged to the second group, wouldn't. I was visualizing name fields, not summary fields in the group 1 header. Can the summaries go in the group 1 footer? But then I suppose you might have the same problem with orphaned footers.

But, I still think report->change group options->option->keep group together on group 1 should work...

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top