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

New Page After ang New Page Before settings 2

Status
Not open for further replies.

yehong

Programmer
Sep 22, 2003
291
US
I have two groups A,B and two group footers.
I want to show each A group on new page and each B group on new page also. The report should like this:

Page 1:

Group A
Group B
Footer B
Footer A

Page 2:

Group A
Group B
Footer B
Footer A

..... and like this for all pages. I have tried setting New Page After and Before settings with different options but not getting what I desire.

Thanks for any ideas.
 
Place the following formulka in the New Page after for Group Footer A:

not(onlastrecord)

Your text betrays your example, so I might be mistaken:

"want to show each A group on new page and each B group on new page also. The report should like this:"

Your example shows Group B on the same new page as Group A.

It may just be a language barrier, perhaps you mean:

"want to show each NEW Group A on a new page and the Group B would be on the same page as it's respective Group A"

If so, the above will work, if not, please adjust either your text or the example accordingly.

Or perhaps you mean that each new B group will be displayed on a new page, but you also want the Group A header to reprint in those instances.

If so, right click group A and select change group and turn on the repeat group headers, and use the above formula in both the Group A footer and the Group B footer.

This is Crystal version dependent, which you'd be well served to share when requesting technical information.

1st thing out of every technical support persons mouth after they've established that they can bill ya ;)

-k
 
If you are looking for a design like:

GrpA Header New England
GrpB Header Boston
GrpB Footer Boston 300
GrpA Footer New England 500

new page

GrpA Header New England
GrpB Header Hartford
GrpB Footer Hartford 200
GrpA Footer New England 500

...because you want to show a summary for the whole group at the bottom of each page, even though it is repeating, then you can do the following:

Make sure you have GrpA formatted to repeat group header on each page. Then create a subreport exactly like the main report, with all sections except the group A footer suppressed. Link the subreport to the main report on the GrpA field and then place the subreport in the page footer.

In the main report, go to format section->Grp Footer B->new page after->x+2 and enter:

{table.grpAfield} = next({table.grpAfield})

Then format Grp Footer A to "Print at Bottom of Page" and also go to "new page after"->x+2 and enter:

Not onlastrecord

Then go to format section->page footer->suppress->x+2 and enter:

{table.grpAfield} <> next({table.grpAfield})

This will give you the above format with the group summary on the bottom of each page.

-LB

 
Version is CR8.5. And let me re-write the example report:

Page 1:
North America:
Div1 200
Total Div1: 200

Page 2:
Div2 340
Total Div2: 340

Page 3:
Div3 0
Total Div3: 0
Grand Total North America: 540

Page 4:
South America
Div1 100
Total Div1: 100

Page 5:
Dive2 50
Total Div2 50
Total South America: 150

..... and like this for all groups and sub groups.
 
Try:

Set the Group A New Page before with the following formula:

not(onfirstrecord)

Set the Group B Header newpage before formula with:

previous({table.grpAfield}) = {table.grpAfield}
and
not(onlastrecord)
and
not(onfirstrecord)

Untested, but it should do it.

-k
 
You are the man Vampire. It works as I desired. Thanks for your help and thanks to Lbass also for his input. Could you elaborate whats going on with the formulae?
 
<
Set the Group A New Page before with the following formula:

not(onfirstrecord)
>

This says not at the beginning on the report so you don't get a blank page right off.

<
Set the Group B Header newpage before formula with:

previous({table.grpAfield}) = {table.grpAfield}
and
not(onlastrecord)
and
not(onfirstrecord)
>

This says if the group A has not changed (compares to the previous record, because you want the first GroupB on the first Group A page), and it's not the first nor last record (neither of which would you want a new page on), then give me a page break and continue.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top