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

Group headers printing at bottom of page with no room for detail recor

Status
Not open for further replies.

jameslx

Programmer
Oct 18, 2001
21
US
I have a report that has group headers with various number of detail records. I would like to keep the header from printing if detail records can not be placed on the same page. FoxPro has an option to not print if the space on the page is less than so may invhes or some other value. Does Crystal Reports have a similar function? Using the new page before printing header gives a header and one detail record on the first page and then the second page starts a new header and enough detail to carry over to a new page. Report looks bad. Allowing Headers to print at all times produces a header and then the details records appear on the next page below a repeated header. This too looks bad. Are ther any calculations that can be used with in the { New Page Before formula }?
 
Thanks for the help, but The problem is worse this way.
Envision this.
Page 1
header 1
1 detail line
page 2
header 2
26 detail lines
page 3
repeat header 2
12 detail lines
header 3
12 detail lines
header 4
page 4
repeat header 4
12 detail lines
this is what you get by chosing keep group together.
What I need is to force a situation where header 4 will not print on a page if the at least 1 detail record can not be printed. I know it can be done in foxpro, I just hoped it could be done with Crystal.
 
No automatic way, but here is a way that does exactly what you want. Make the GH deep enough so that it can hold another copy of all of the fields in the detail section. This will print a second copy of the first record of each group. Then, suppress the first Detail record of each group, using a running count field and a conditional suppress formula. Since the GH will be kept together, the GH will always print with the first detail. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
kenhamady :
Thanks. I will try this in the next day or so and see if it helps.
 
kenhamady :
Thought your idea had solved the problem, but on further review - If there is enough room for the header with the first detail record to print it does and then on the following page it prints the header with the first detail record and the prints detail from record 2 - end. Now on one page I have the first record and then on the next page I have it again, If user adds up totals the qty from first record plus the true total on the next page would be off by the amount in the first record. Still a problem looking for a solution. Too bad Crustal can't detect the amount of space left on the report to print to.
Thanks for the help. If any one else has an idea let me know.
 
Are you using the Group option to "Repeat header on each new page?" If so, you can suppress the detail fields using the InRepeatedGroupHeader function. You might even split this GH into two sections and suppress the second section using this function. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top