Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Page breaking with multiple groups Post Reply Post New Topic
Author Message
calvin-c
Newbie
Newbie
Avatar

Joined: 18 Dec 2006
Location: United States
Online Status: Offline
Posts: 6
Quote calvin-c Replybullet Topic: Page breaking with multiple groups
    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.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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>
IP IP Logged
calvin-c
Newbie
Newbie
Avatar

Joined: 18 Dec 2006
Location: United States
Online Status: Offline
Posts: 6
Quote calvin-c Replybullet 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.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.