Print Page | Close Window

Page breaking with multiple groups

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=62
Printed Date: 27 Apr 2024 at 9:48am


Topic: Page breaking with multiple groups
Posted By: calvin-c
Subject: Page breaking with multiple groups
Date Posted: 18 Dec 2006 at 9:04am
Here's something that should be fairly common in reports, yet I can't find a way to do it.

I'm working on a report with subtotals for multiple groups, e.g. Company, Branch, Department, Salesperson. The requestor wants a page break between each Department, but they want the Branch subtotal to appear on the same page as the last Department in that Branch.

If I select New Page After on the Department group footer then the Branch subtotals appear on a separate page-not what is wanted. If I leave it off the Department group footer then I don't get the wanted page breaks between departments.

Either I'm missing something or I need to use a formula to control the page breaks & I can't figure out what it would be.

Advice?

Thanks.



Replies:
Posted By: BrianBischof
Date Posted: 18 Dec 2006 at 9:24am
You could have a section that displays the Branch Total at the bottom of each Department grouping. But use a formula to disable it if the Branch of the next group is the same as the current Branch. That way it only displays when the Branch changes (the last department of that Branch). You will also have to display it for the last record in the whole report.

You can use Crystal syntax Next({Customer.Branch}) function to find the next field's Branch value and use OnLastRecord function to test when the last record of the report is printing.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: calvin-c
Date Posted: 18 Dec 2006 at 9:50am
Thanks. I got a solution from a co-worker using New Page Before in the group header, but I think this solution will solve some other problems I'm having (like having the Salesman group name in both the group header, so it appears in mid-page when the salesman changes, and also in the page header so it is repeated at the top of the next page when the salesman's detail listings span multiple pages).

I'll play around with the Next function & hopefully remember it for the future.


Posted By: hilfy
Date Posted: 20 Dec 2006 at 11:05am
You could also put a formula on the Department's NewPageAfter that looks something like this:
 
Not OnLastRecord and ({table.branch_field} = next({table.branch_field})
 
You would also then put a NewPageAfter on the Branch footer with Not OnLastRecord in the formula.
 
The "Not OnLastRecord" prevents a blank page from appearing at the end of the report.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window