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!

Keep Group Together Conditionally?

Status
Not open for further replies.

lazedad

Programmer
Feb 11, 2002
2
US
With CR7, I have a Group where the majority of values have only a few detail lines, but a few values have a lot of detail lines. For the majority, I'd like to 'Keep Group Together'; for the few with a lot of Detail lines, I don't want the page break (isn't room to print the entire group).
So for these few, I don't want 'Keep Group Together'.

I really appreciate any help, as I've struggled with using a formula for the group, two different groups based on the same field, and other equally fruitless solutions(!).
 
forget the "keep together" altogether.

Hopefully your report is such that you know how many lines you can have before there is a problem...if this is so...then put a line counting formula in the detail line.

@LineCounter

WhilePrintingRecords;
numberVar Linecount;
linecount := LineCount + 1;

then in the section expert for the detail line...place a the following formula in the "New Page After" conditional

WhilePrintingRecords;
numberVar Linecount;
linecount = (whatever number you want);

Make sure to have an initialization formula to reset the counter for a new group value

@initialization

WhilePrintingRecords;
numberVar Linecount;

if not inRepeatedGroupHeader then Linecount := 0;

hope this helps...Jim
 
Hi Jim,

I'm probably being dense, but it seems like this approach would not keep any of the Group Values together. I'm looking to retain the "Keep together" functionality for the majority of the group values, it's just the few Group Values that possess a ton of Detail records that I'm trying to avoid the big break before the next group. In other words, I don't want a group header printing at the bottom of a page by itself, but can't find a way to prevent it and still retain full pages on the report.

Is there any way to retain this "keep together" functionality selectively?
 
don't think so...this is the way I do it...other formulas would be used to control other sections.

for example for headers...I would use a "New page before" check to make sure a header started on a new page. Except I would but a formula in the conditional section

Whileprintingrecords;
not onfirstrecord;
 
you can set your report so that your group header is not orphaned at the bottom of the report, is that what you are looking to do??

lmc
cryerlisa@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top