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!

Keep Group Together Option 1

Status
Not open for further replies.

DanR

Technical User
Sep 6, 2001
16
US
I've built a report that has numerous sub-reports in it at various grouping levels. In an effort to keep these sub-reports and other grouping level data together, I have turned on the keep group together option. My report structure looks like the following.

Group Header 1 is set to repeat on all pages.
Group Header 1a - Sub-report
Group Header 1b - text fields

Group header 2

Details a
Details b
Details c - sub-report

Group footer 2 - sub-report

Group Footer 1a - sub-report
Group Footer 1b - text fields

if Crystal determines that group footer 2 will not fit on the same page as the last detail record, it is moved to the next page and group header 1 is printed on that page (since I have it set to repeat on all pages). However, if group footer 1 will not fit on the same page as group footer 2, it is moved to the next page, but the group header 1 does not print on that page.

Is there any way to force group header 1 to print on the page?
 
That is tricky...my approach would be to build another subsection in the Group 1 footer and make it a "fake" Header

That is ...it would have the same layout and fields as the normal header.

Once you do that the real tricky part is controling its display

So I would put a suppressed formula into the Group 2 footer

//@CapturePageNumber (suppressed in GF2, out of the way)

WhilePrintingRecords;
NumberVar PNum := PageNumber;


NOW

In the conditional suppress of the section GF 1a (the fake header) put the following formula

WhilePrintingRecords;
NumberVar PNum;

PNum = PageNumber;


This might work but sometimes Crystal doesn't recognize a new page number in a footer....not hard to do so you might give it a try.

Hope it works.


Jim Broadbent
 
I might be missing an essential piece, but what happens if you take the GH that should appear at the top of every page, and make it into a page header? Then it will appear at the top of every page no matter what.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- tek@kenhamady.com
 
Sometimes, it just takes someone else to point out the obvious. It looks like moving the info to the page header may just work in this instance.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top