Print Page | Close Window

Starting New Group Header on Odd Numbered Page

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=6302
Printed Date: 06 May 2024 at 11:55pm


Topic: Starting New Group Header on Odd Numbered Page
Posted By: Galb
Subject: Starting New Group Header on Odd Numbered Page
Date 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.
 



Replies:
Posted By: DBlank
Date 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


Posted By: Galb
Date Posted: 08 May 2009 at 2:07pm
Thank you DBlank.  I'm learning and will give this a try.


Posted By: Galb
Date 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.


Posted By: DBlank
Date 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
 


Posted By: Galb
Date 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.


Posted By: DBlank
Date 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


Posted By: mcohen
Date 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! 


Posted By: DBlank
Date 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.


Posted By: mcohen
Date 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.


Posted By: BenKason
Date Posted: 22 Sep 2010 at 1:23pm
I think I may have figured this out...

I created a second Group footer with a blank text field in it. For this section in the Section Expert, I checked the "New Page Before" option. Then in the formula box to the right of "suppress" I entered this formula:

(Remainder(pagenumber,2)=1)


This got me my blank page at the end of the group. This section is suppressed though if there are an even number of pages though so you don't get the blank page.

Seems to have worked. It gives me a couple of empty pages at the end of the report that I need to figure out , but seems good so far.


Posted By: mcohen
Date Posted: 24 Sep 2010 at 8:52am
Thanks for sharing your creative solution!


Posted By: mikevtss
Date Posted: 17 Jul 2016 at 2:28pm
Hi Dblank,

I was trying to get this working on my report

It dose not seem to work maybe because I have multiple group headers and footers?



So basically I have in Group header 1A is the Group field

all the other headers have just data layout for the form

Group footer A and b have a sub report each. C is blank as I was playing around tying to get a blank page.


Posted By: mikevtss
Date Posted: 17 Jul 2016 at 2:35pm
actually did what Benkason did and it seem to work,



Print Page | Close Window