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

Keep groups on same page 1

Status
Not open for further replies.

dBjason

Programmer
Mar 25, 2005
355
US
I have a report with 1 group (header, footer, and detail line). Is there any way to keep all of the information on the same page? I don't want to use the new page before/after because there's only about 5 detail lines per group and multiple groups can fit on one page. I just don't want to start printing the group unless it can finish it on the same page.

In Access reports there's a "keep together" setting. Is there anything like that in Crystal? Or at the very least, how can I print the group header if the detail line spills over onto a new page?

Thanks in advance,
Jason
 
In the Group Options, there is a 'Keep Group Together' option. That sounds like what you want. Depending on your version of CR, the steps to getting there may be different.

For CR 8.5: Report menu > Change Group Expert > click the 'Options' button
For CR 10 (and likely 9 and XI): Report menu > Group Expert > click 'Options'

-dave
 
My problem is similar, but I am only looking to NOT have the group header print if it's the last thing on the page. As long as at least one record comes after it, I don't mind the group being broken. But I hate when the group header appears at the bottom and the first record of that group starts on the next page.

Is there some kind of code that can maybe be used with the "New Page Before" or something? Or am I left with only the "Keep Group Together" option?
 
If your report sections are of similar height, you could count lines on the page using the following formulas:

//{@reset} to be placed in the page header:
whileprintingrecords;
numbervar linecnt := 0;

//{@linecnt} to be placed in every displayed group header and footer
//and detail section:
whileprintingrecords;
numbervar linecnt := linecnt + 1;

Then note the value at the end of the page (let's say it is 50) Then go to the section expert->group header->new page before->x+2 and enter:

{@linecnt} = 50

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top