Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Last Page for Terms&Conditions Post Reply Post New Topic
Author Message
PTMoore
Newbie
Newbie


Joined: 14 Oct 2011
Location: United States
Online Status: Offline
Posts: 5
Quote PTMoore Replybullet Topic: Last Page for Terms&Conditions
    Posted: 14 Oct 2011 at 7:20am
I'm trying to add a last page of terms and conditions for a sales order form.  I've searched for information on this but nothing I've tried has worked.   Currently I'm printing the terms and conditions on the report footer, using New Page After.  It goes to a new page and prints, however so do the page headers and footers.  I've tried suppressing them using onlastrecord and using PageNumber=TotalPageCount.  The problem is that on a one page order  the system assumes the 1st page is the last page and doesn't print the headers/footers at all.  Even though in preview it shows 2 pages, the report only shows Page 1 of 1.  Any Ideas of what I'm doing wrong or another way to do this?     
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Oct 2011 at 3:50am

Not exactly sure your issue.

If you have the report footer set to new page before you should alwasy have 2 pages so if you suppress the pager header using your PageNumber=TotalPageCount you should be fine...?
 
IP IP Logged
PTMoore
Newbie
Newbie


Joined: 14 Oct 2011
Location: United States
Online Status: Offline
Posts: 5
Quote PTMoore Replybullet Posted: 17 Oct 2011 at 3:57am
That is what I thought.  When I force the report to go to a second page for the terms and conditions a second page is generated.  However Crystal Reports is still only detecting the original one page.  The totalpagecount is still only 1.  The page counter on the report still only shows page 1 of 1 on the second page.  Therefore it detects page one as being the last page and doesn't print the page headers and footers for the first page. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Oct 2011 at 4:35am
are you sure you are not resetting the page count in the section expert somewhere?
My testing is giving me the expected totalpage count of 2 an page number of 1 and 2 (respectively).
IP IP Logged
PTMoore
Newbie
Newbie


Joined: 14 Oct 2011
Location: United States
Online Status: Offline
Posts: 5
Quote PTMoore Replybullet Posted: 17 Oct 2011 at 4:54am
I think that is it.  I'm modifying an existing ERP Sales Order form and it is resetting the page number after a group footer prints.   I took it out and the page numbers do what I was expecting.  I'll have to play around with it to make sure the original functionlity is kept, but that should get me going.  Thanks!  I thought it had to be something simple I was missing.
IP IP Logged
dodyryda
Newbie
Newbie


Joined: 20 Mar 2012
Online Status: Offline
Posts: 4
Quote dodyryda Replybullet Posted: 20 Mar 2012 at 10:06pm
hi.. I've been trying to achieve the same thing. But struggling to get it to display correctly. I have used the pagenumber = total pagecount formula which does suppress the header on the first page..

but the trouble is I get the content on the 1st page and then on page two the report footer is split and on page three you see a little more of the report footer and page four a little more. finally the last page I get no headers (as expected) and the last bit of the report footer.. I have the option keep together ticked for the report footer in the section expert. does anyone know why it would split the report footer? and maybe how to stop it.

Many Thanks
IP IP Logged
dodyryda
Newbie
Newbie


Joined: 20 Mar 2012
Online Status: Offline
Posts: 4
Quote dodyryda Replybullet Posted: 20 Mar 2012 at 11:28pm
kind of getting somewhere. I used onlastrecord to suppress the headers instead of pagenumber = totalpagecount and this seems to have helped. However I'm still getting a large whitespace at the bottom which is splitting my terms and conditions page. I presume it's the page footer I have enabled the suppress blank section option but no matter what it still displays.. how can I stop it???
IP IP Logged
dodyryda
Newbie
Newbie


Joined: 20 Mar 2012
Online Status: Offline
Posts: 4
Quote dodyryda Replybullet Posted: 21 Mar 2012 at 5:39am
Hi  .. just managed to get this to work after fiddling around for bloody hours!!..

here's what I did if it helps anyone,. scrap your page footer - it doesn't work and just prints white space which is really annoying.. move your page footer content into the last group footer. If necessary you may have to create a new group and move your current groups so the last group footer is free for your page footer content. go to the section expert and check the box print at bottom of page. enter a suppression formula of onlastrecord to this group footer section as well so it doesn't print on the last page where you want the terms and conditions..

stick your terms and conditions in the report footer section and make the page footer take up no space...

IP IP Logged
dodyryda
Newbie
Newbie


Joined: 20 Mar 2012
Online Status: Offline
Posts: 4
Quote dodyryda Replybullet Posted: 22 Mar 2012 at 6:59am
further testing revealed the onlastrecord supression of the header was not working where only one record returned .. fixed with the help of this solution below

http://stackoverflow.com/questions/3294027/crystal-reports-suppress-a-page-header-if-the-page-has-0-records

First, you have to create a formula. Then, insert it into to the Details section. For example @VariableA

Inside the formula, put this:

Shared NumberVar PageofLastField;

If OnLastRecord then PageofLastField := PageNumber;

Suppress formula.

The formula checks if the record is the last record. If it is the last record, it saves the Page Number where the last record is to the shared variable PageofLastField. Then on the Suppress formula of your header, put this code:

Shared NumberVar PageofLastField;

PageofLastField := PageofLastField;

if pageofLastfield <> 0 and PageNumber > PageofLastField
  THEN TRUE
ELSE FALSE



Edited by dodyryda - 22 Mar 2012 at 7:00am
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.047 seconds.