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!

5 Group section. How to implement 'New Page After' ? 2

Status
Not open for further replies.

yehong

Programmer
Sep 22, 2003
291
US
I am using CR8.5. I have a report with five groups, i-e:
Country
State
City
Location
Department.
Here is the report sample

US (gr 1) [gr=group]
VA (gr 2)
Fairfax (gr 3)
N.Winds Circle (gr 4)
Finance (gr 5)
FNameLName1 03/13/2003 $3000
FNameLname2 05/03/2001 $2000
...
Now if same country, city, and location has another location (say S.Crosstimbers) with same Finance dept, then it should print it's details on a new page. Similarly same logic should also work for all five groups. I tried using 'Previous' function but still no luck. Thanks.
 
have you tried this?

Go to the GF for Location
Format Section
New Page After

Each time the Location changes, a new page will start. Not sure if this is exactly what you need. Try it.

Then work your way up the list, City, State, country, turning on the New Page After.

 
Hi Crystalguru. I know I can use 'New Page After' option to force a new page after each GF section. My question is little bit different here. This is how the out put should look like for this report:
Locations are imaginary as I don't live in VA.

----------
Page 1
US
VA
Fairfax
N.Winds Circle
Finance Dept
FNameLName1 03/13/2003 $3000
FNameLname2 05/03/2001 $2000
--------------
Page 2

US
VA
Fairfax
S.Crosstimbers
Finance Dept
FNameLName3 03/11/2003 $2000
FNameLname4 05/04/2001 $1000

--------------
Page 3

US
VA
Fairfax
S.Crosstimbers
HR Dept
FNameLName5 02/11/2003 $3000
FNameLname7 06/04/2001 $1500

----------------
Page 4
US
VA
Fair Oaks
Lawndale
HR Dept
FNameLName6 05/11/2003 $500
FNameLname8 09/04/2001 $150


I hope above sample makes sense. The idea is to force a page break anytime a group value changes. All five groups have be repeated on each page.
 
Could you not simply check 'New Page After' for GF5 section

Gary Parker
MIS Data Analyst
Manchester, England
 
I'd have thought you needed an automatic 'New Page After' for GF4. Maybe also a 'Keep Group Together' for Group 5, so that a new page will begin for a department in the same Group 4 if the whole of the entry won't fit. Note that there is also 'Repeat Group Headers On New Page', even in Crystal 8.5.

If that doesn't do it, please post the 'Previous' that did not work.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
And check "Repeat group header on each page" in Group Options for Gr 1-4

/Jonas
 
Thanks guys. Let me write a simple sample here.
Let's say we have only two groups Country and State.

------------
page 1
US (GF1)
VA (GF2)
Details.1.......................
Details..2......................
Details..3......................
---------------
page 2 (do not force new page coz State is still VA)
US
VA
Details5........................
Details6........................
Details.8.......................
Details.9.......................
---------------------------
page 3 (force new page because State has changed)
US
TX
Details.4.......................
Details..7......................
Details..10......................

I need to force new page only when State value changes, otherwise continue printing records.I used in the X+2 of 'New Page After' for GF2 this formula:
{Table.State}<>Previous({Table.State}). This works fine when I have only two above groups but don't know how to implement it for 5 groups.
I hope this this make sense.
 
Please clarify
implement it for 5 groups
Specifically, what are wanting to do that cannot be done using methods you have already been told about.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Madawc,I want to use the same functionality for five groups. I have set repeat all group headers on each page to be true.
Page 1 should look like
US-VA-Fairfax-S.CrossTimbers-HR
....10 records.....

Page 2
US-VA-Fairfax-S.CrossTimbers-Finance
....5 records......

Page 3
US-VA-Fairfax-N.Winds Cricle-HR
.....4 records.....

Page 4
US-VA-Fairfax-N.Winds Cricle-IT
.....3 records.....

Page 5
US-VA-FairOaks-Landale-HR
....2 records.....

Page 6
US-TX-Austin-N.Lamar-IT
.....6 records...

Page 7
UK-London State-London-Slake Street-IT
....34 records....
and so on....

AS you can see any of those five groups can change anywhere and anytime a group changes, we have to insert a page break.
 
For each group footer, try a formula like the following in the new page after->x+2 area:

//for group footer #5:
{table.groupfield4} = next({table.groupfield4}) and
{table.groupfield5} <> next({table.groupfield5})

//for group footer #4:
{table.groupfield3} = next({table.groupfield3}) and
{table.groupfield4} <> next({table.groupfield4})

//for group footer #3:
{table.groupfield2} = next({table.groupfield2}) and
{table.groupfield3} <> next({table.groupfield3})

//for group footer #2:
{table.groupfield1} = next({table.groupfield1}) and
{table.groupfield2} <> next({table.groupfield2})

//for group footer #1:
not onlastrecord

-LB
 
You should be able to check "new page after" in group footer 5 and that should to it! It works for me when I test it. I believe that crystal considers that a group has changed if the value of any of the groups above it has changed.

MrBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top