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

Widowed Group Headers 3

Status
Not open for further replies.

janemaritz

Technical User
Nov 8, 2002
18
US
I have a lot of group headers with no detail beneath them - the detail is appearing on the next column or the next page. If there is not room for any detail, I'd like the group header to be printed on the next column/page. Is there an easy way to keep the header with at least one detail record beneath it (i.e. widow/orphan control)?

Thanks
 
have you tried checking the option to 'underlay following section"? it is located in the Section Expert...

you would highlight the header you are wanting to change, and then check the box for underlying sections... that should help - good luck

[americanflag] ShannonLea [americanflag]

"I keep hitting 'escape' but I'm still here..."
 
do a search on the forum....or check with Ken H.

I used to do this with complicated line counting but there is an elegant simple way of solving you problem ...that escapes me right now :)

Jim Broadbent
 
You should be able to use the Change Group and choose the option to Keep Group Together...I think this keeps everything together as far as the Header and first record beneath it...

DLC
 
you can do that but depending on the report this can lead to ugly white gaps on your pages....

Jim Broadbent
 
Thanks all.

The Keep Group Together option doesn't work for me, since I want the group detail to split on pages and columns as long as there is at least one record with the group header. Using this option gives me too much white space.

I am trying variations of the Underlay Following Section option, but haven't had success yet. It works if I leave a lot of space at the top of the first Detail section, but then I have a lot of white space between each Detail record. To fix this, I've tried inserting a 'blank' Detail section that is suppressed if the running total count for that group is >1, but for some reason this still allows widowed headers, even though the Detail sections are set to Keep Together.

Any other ideas?
 
I think this is the answer

In the Group header make it big enough so that it can also have the first data record for the group

so you have something like this


------------------------------
Group header information
Group header
{Table.field} {Table.field2}
------------------------------
{Table.field} {Table.field2} Detail section
------------------------------

So in essence the first record of a group is always printed in the Group header

Put the following formula in the Group Header

@SuppressFirstRecord

whilePrintingRecords;
numberVar SFlag := 1;

In the conditional suppress for the detail section put the following formula

whilePrintingRecords;
numberVar SFlag ;

if SFlag = 1 then
(
SFlag := 0;
True;
)
else
False;

this will suppress the first record of a group in the detail section....MAKE SURE YOU DON"T REPEAT GROUP HEADERS

this is quite an elegant solution...which leaves a minimum of white space when the Header/1st record are dragged over to a new page.

Jim Broadbent
 
yeah it works great....much better than my other...horrendously complicated solution...Glad to help

Jim Broadbent
 
Now I'm at a loss. I have several sections in Details and want to keep them together for each record (sections are for address lines: Details a is name, Details b is address1, etc.). I've selected 'Keep Together' for Details in the Section Expert.

This works great except for the second record of each group (the first record being the one included in Group Header per selection above). I can't figure out how to keep the record sections together for this one; it keeps 'orphaning' the first line of the second record if it is at the bottom of a column/page.

Ideas?

Thanks,
Jane Maritz
 
this is a case of solving a problem ....one tiny bit at a time....Tell the whole story about what you want to keep together....show us the layout completely.

My solution works when there is one section to a detail....not many many subsections.

It is not necessary to breakup an address into many subsections...the only reason to attempt to do this is to suppress missing address information.

An Address formula like the following gets rid of this problem

@Address

WhilePrintingRecords;
StringVar Result := "";

If not isNull({Table.name}) then
Result := Result + {Table.name} + chr(13) + chr(10);

If not isNull({Table.Address1}) then
Result := Result + {Address1} + chr(13) + chr(10);

If not isNull({Table.Address2}) then
Result := Result + {Table.Address2} + chr(13) + chr(10);

If not isNull({Table.City}) then
Result := Result + {Table.City} + ", " ;

If not isNull({Table.Prov/State}) then
Result := Result + {Table.Prov/State} ;

Result;

Place this in a "Can Grow" enabled field and you eliminate several detail lines.

BUT I REPEAT My solution works if there is one detail line.

If after this change there is still more subsections....LAYOUT YOUR REPORT COMPLETELY....otherwise it is a waste of time designing a solution that requires modification (at best) or total rethought (more the case) becasue the WHOLE story was not given .


Jim Broadbent
 
Thanks, Jim. I had adapted your initial solution for a multi-section Detail. There are more fields than just address, though I could probably adapt the address solution you've given with a little thought. I'm using mixed formatting and indents, though, so I haven't gone that route yet.

Anyway, I've solved the issue simply by inserting a blank section as the first Detail section. If this gets orphaned, it is not noticeable on the report. As I had mentioned earlier, it is only the first subsection that is being orphaned; all the rest 'keep together'. Wish I had a better understanding of why it did that, but will just accept it for now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top