Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Starting New Group Header on Odd Numbered Page Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Galb
Newbie
Newbie
Avatar

Joined: 08 May 2009
Location: United States
Online Status: Offline
Posts: 4
Quote Galb Replybullet Topic: Starting New Group Header on Odd Numbered Page
    Posted: 08 May 2009 at 12:56pm

To save paper, my reports go to a printer that prints on both sides of the page (duplex).  For most reports this is not an issue.  However, I have a new report that has Group Header #1 which needs to start on an odd numbered page each time the header information changes.  I know how to start a new page before and/or after a group, but is there a way to have Crystal skip a page if necessary in order to start each new group on an odd numbered page?  I don't want one group to end on page 3 and the next group to start on page 4.  If a group ends on an odd numbered page, I want the next group to start on the next odd numbered page.

Any suggestions are appreciated.
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 May 2009 at 1:26pm

Assuming you have a new page before each GH1 can you also just add a conditional new page after the groupfooter1 if the page number is odd.

pageNumber Mod 2 = 1
IP IP Logged
Galb
Newbie
Newbie
Avatar

Joined: 08 May 2009
Location: United States
Online Status: Offline
Posts: 4
Quote Galb Replybullet Posted: 08 May 2009 at 2:07pm
Thank you DBlank.  I'm learning and will give this a try.
IP IP Logged
Galb
Newbie
Newbie
Avatar

Joined: 08 May 2009
Location: United States
Online Status: Offline
Posts: 4
Quote Galb Replybullet Posted: 08 May 2009 at 2:46pm
Well I'm obviously not doing it correctly.  On my report I have Page N of M on the page footer and am resetting the page numbering when the group changes.  I've now placed a Page Number field in my group footer #1 and went to the Section Expert where I put the code you gave me into a formula for New Page After.  I'm not getting the results I need so I am obviously missing something.  If you could give me a bit more detail I would appreciate it.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 May 2009 at 3:17pm

What I assum you are looking for here is that you never start a new group on the back page of the two side page and that you always want a new group to start on a new page. Corrrect?

Do not reset the page number.  That will throw this process off. If that is a report criteria let me know because this process wouldn't work if you did that.
Don't bother placing the page number in any group footer. You don't have to have it there to use it as a condition.
(As an FYI using page N of M can really slow down a report if it is large).
In the section Expert highlight the GH1
Click on the formula field next to the New Page Before and put in the formula Not onfirstrecord
(do not check the box just put in the formula)
This will make it go to a next page before it starts a new group header except for page1 (not onfirstrecord).
highlight groupfooter1
Click on the formula field next to the New Page After and put in the formula pageNumber Mod 2 = 1
(do not check the box just put in the formula)
This should make it create a new page after the group footer only if that footer falls on an odd numbered page. If you reset the page numbers after each group it is always going to be considered page 1 regardless if it is the front or back of your paper.
 
This should work. I tested the concept and works fine in my sandbox report.
Basically this is what you have...
If your group ends on page 1,3,5,7,etc. it will start a new page after the groupfooter (your conditional new page on after GF on odd pages).
This pushes the group header to page 2,4,6,8,etc.. Since you also have new page before the group header that should move it to page 3,5,7,9,11,etc. leaving page 2 blank before it starts printing.
Hope this makes sense Smile
 
IP IP Logged
Galb
Newbie
Newbie
Avatar

Joined: 08 May 2009
Location: United States
Online Status: Offline
Posts: 4
Quote Galb Replybullet Posted: 08 May 2009 at 4:10pm
Hello DBlank.
 
I really appreciate your efforts, but it is not working in my report. 
You are correct in that I am printing on both sides of the paper and do not want a new header section starting on the back of a page so I can easily distribute the various sections to the appropriate staff. 
 
I have removed my page numbering as well as turned off the "reset page number after".  In the Section Editor I selected my Group Header #1 and clicked the formula button, being careful not to check the New Page After box.  I typed "Not onfirstrecord" which turned blue after I typed it.  I clicked the check formula button and it said there were no errors so I clicked Save and close.
 
Then I selected by Group Footer #1 and again, being careful not to click the box next to New Page After, I clicked formula button and typed "pageNumber Mod 2=1" which also turned blue except for the "2=1" which remained black.  Clicking the check formula button said it was good so I clicked Save and close.
 
Running my report (500 plus pages) still results in new header sections starting on the back of a page instead of leaving the back of the page blank.
 
So, I'm going to call it quits for the weekend, and tackle it again Monday morning.  Thanks again for your time and assistance.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 May 2009 at 4:21pm
Header formula goes in "new page before"
Footer formula goes in "new page after"
See if that fixes it for you
IP IP Logged
mcohen
Newbie
Newbie
Avatar

Joined: 20 May 2009
Location: United States
Online Status: Offline
Posts: 8
Quote mcohen Replybullet Posted: 20 May 2009 at 1:53pm
Hi - I have a similar situation but I have two requirements:
1) starting each new group on the front of a two-sided page
2) resetting the page number at the beginning of each new group. 
As you have pointed out, you cannot use Reset Page After without interfering with the New Page After formula for when the group ends on an odd-numbered page.  So far, I can only do one or the other but not both.  Is there a way to do this?  Thanks in anticipation! 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 May 2009 at 1:55pm
I wouldl try to use a variable as a substitute for displaying the page number and reset the variable after each group.
IP IP Logged
mcohen
Newbie
Newbie
Avatar

Joined: 20 May 2009
Location: United States
Online Status: Offline
Posts: 8
Quote mcohen Replybullet Posted: 21 May 2009 at 1:59pm
Thanks - had tried before without succcess, but finally got it to work by having the page number variable displayed in the page header rather than the page footer.
IP IP Logged
Page  of 2 Next >>
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.