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!

Controlling Page Breaks in 8.5 2

Status
Not open for further replies.

jpaars

Programmer
Feb 24, 2004
7
US
I'll start with some background:

Pretty typical report with two groups. Group 2 is set to "keep together" and there is no footer to Group 1, so I've pretty much got...

GH1
G2
G2
GH1
G2
etc


What I want to do is "stick" the Group 1 header to the first Group 2 so I'm not left with a hanging Group 1 header on the bottom of one page while the Group 2s start on the next. Page breaking between Group 2s is okay and setting Group 1 to "keep together" is not really desirable because it will page break for a longer group when there's plenty of page space left to at least start the group before the page break. Does that make sense?

So here's the two options that I've come up with, neither of which I know how to do or even if they're possible:
1. Somehow tell it not to page break after GH1 or
2. Come up with a formula to put in "page break before" of GH1 that would start a new page if a GH1 was about to be started too far down the page.

Basically, my question boils down to, "How can I prevent a hanging group header at the bottom of a page without keeping the whole group together?" Any help would be appreciated. Thanks.
 
Have you tried selecting the "new page before" option for your group header? Also you can select "repeat group header on each page". This way if the details are longer than one page the header is repeated on the second page.

Kchaudhry
 
Well, there's usually room for 3-4 groups (longer groups notwithstanding) on a page, so selecting "new page before" creates many unnecessary page breaks.

I'm actually already repeating the group header on each new page. What I'm trying to avoid (for asthetic reasons) is leaving the group header on the bottom of a page with nothing underneath it.

Thank you for your help, though.
 
Maybe this will help. You can create a formula which will show text "continued from previous page" in the header.

{@GroupHeaderText}
If
InRepeatedGroupHeader
Then
GroupName ({Table.GroupField}) + ' Continued from previous page...'
Else
GroupName ({Table.GroupField})

Please note in order for this to work you will have need the "repeat group header on each page" selected.


Kchaudhry
 
Yep, I've actually already done this too (or an equivilant really) so let me say that I like the way you think and I appreciate the help. But, again, I'm not concerned with what's going on at the top of the second page so much as what's going on at the bottom of the first page. Maybe if I illustrate it better...

This is not okay (or what I've got now and what I'm trying to correct):
--page 3--
etc
etc
GH1
--page break--
--page 4--
(cont)GH1 repeated
G2
G2
etc
etc

This is okay (or what I'm trying to acheive):
--page 3--
etc
etc
GH1
G2
--page break--
--page 4--
(cont)GH1 repeated
G2
etc
etc

Or simply moving the header to start the whole group on the next page if would otherwise "hang" (but only if it would otherwise hang, not before every GH1).

That "hanging" group header on the previous page is superfluous and what I'm trying to prevent if possible. I realize that I may be getting too picky and trying to do too much.
 
You could try the following:

In report-> change group options, highlight group #2 ->options->and check "Keep Group Together" and also check "Repeat Group Header on each Page."

Suppress Group Header #1. Insert a second Group Header #2, and drag Group #2 header fields into Group Header #2_b. Then drag the Group #1 Name into Group Header #2_a. Go to the section expert-> Group Header #2_a ->suppress->x+2 and enter:

if not inrepeatedgroupheader then
{#grpcnt} <> 1

...where {#grpcnt} is a running total using the running total editor: select {table.group#2field}, distinctcount, evaluate for each record, reset on change of group 1.

This should cause the Group #1 Header to always appear with the Group #2.

-LB
 
That worked wonderfully!

Thanks to lbass and kchaudhry for their help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top