Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Suppress Page Footer.......... Post Reply Post New Topic
Author Message
AntDC
Groupie
Groupie
Avatar

Joined: 23 Dec 2008
Online Status: Offline
Posts: 76
Quote AntDC Replybullet Topic: Suppress Page Footer..........
    Posted: 01 Apr 2009 at 3:37am
I have a simple report which is grouped by customer showing their orders.

Customer name etc shown in Group Header.
The orders are shown in the Detail section.

The page footer has a tear off part, which I only want to print on the first page of each group.  ie - 1 per customer.
Easy peasy you'd think.

In the group header suppression code I have the following..........

Shared BooleanVar TearOffPrinted;
TearOffPrinted := false;
false;  //DON'T SUPPRESS THE HEADER

In the page footer I have the following...............

Shared BooleanVar TearOffPrinted;
Local BooleanVar bSuppressThis;
// set suppression state to whether we printed the tear off yet
bSuppressThis := TearOffPrinted;
// we can now set that the tear off has been printed
TearOffPrinted := true;
// return state of when we entered this footer (ie. did we print the tear off yet?)
bSuppressThis;

However, upon testing it is apparent that if the Detail section spans more than one page the tear off section is also shown on the second page.
If the detail band fits on just the one page, then all is well.

It's as if Crystal hasn't fully 'processed' the page footer until the Detail section is complete?!?!?!!?

I have created a sample illustrating the problem, so if you're up for a puzzle, reply as such and I'll send it to you.

Any help would be gratefully received....

TIA

DC

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 01 Apr 2009 at 6:23am
I am assuming that the code for the page footer is in the suppression code.
 
If the group header is printed on every page, that might be resetting the printed boolean.  Since you never suppress the group header, you might move the code into a formula and drop that on the group header.
 
To suppress the false add a line to the formula that is ""...the formula just displays the empty string.
 
Hope this helps
IP IP Logged
AntDC
Groupie
Groupie
Avatar

Joined: 23 Dec 2008
Online Status: Offline
Posts: 76
Quote AntDC Replybullet Posted: 02 Apr 2009 at 4:02am
No, the group header is not printed on each page, only at the tsrt of the group.

In my post I simplified the issue somewhat.
In fact, the report in question has a number of subreports between the header and footer.
With a simple example I can count the number of rows in the detail and set TearOffPrinted in a formula field.
However, doing this in the report proper would be a lot of work and that's why I posted here.

Any other ideas well appreciated.

DC
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 02 Apr 2009 at 6:09am
The only other idea that comes to mind is to have 1 shared variable and have each subreport add to it what their number of lines are.  then you could have a formula to access this and tell the footer to print if it is less than some predefined and force a page break if needed.
IP IP Logged
AntDC
Groupie
Groupie
Avatar

Joined: 23 Dec 2008
Online Status: Offline
Posts: 76
Quote AntDC Replybullet Posted: 02 Apr 2009 at 6:40am
Yes mate.
I'm pretty resigned to that.  The problem is that the whole report is so flexible that that in itself woul be a headache.

I'm experimenting with having another 'dummy' page footer above nad setting the vars in there. 

Either way, once I find a solution, and by God I will, I'll post back to here.

Thanks for your input & regards

DC
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.012 seconds.