Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Detecting Group Footer Section Post Reply Post New Topic
Author Message
PongGod
Newbie
Newbie
Avatar

Joined: 10 Jan 2012
Online Status: Offline
Posts: 2
Quote PongGod Replybullet Topic: Detecting Group Footer Section
     Posted: 10 Jan 2012 at 9:29am
I have a report where I'm putting a sub-report into a Group Footer and it is configured to always begin printing on a new page.  I have a formula that displays some text in my Page Header and want to modify it so that it will conditionally display something different when the page contains the Group Footer sub-report rather than the rest of the main report detail.

How do I make this determination?

- Robert -
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 11 Jan 2012 at 4:13am
What I have done in the past to accomplish this is to make sure the Group footer has at least three sections (GF 1a,1b,1c). In group footer 1a you will have a variable declaration that can be something like:

whileprintingrecords;

global numbervar nSubreportHeader:=1;


Be sure GF 1a is suppressed and set the Paging New Page After to ON.

In GF 1b, put your subreport.

In GF 1c, place another variable declaration:

whileprintingrecords;

global numbervar nSubreportHeader:=0;


Suppress GF 1c and, if necessary (which I believe it would be), set the Paging New Page After to ON.

Now, create two Page Headers A and B. Let A be for your regular detail and B for your subreport. Set the suppression of section A to:

global numbervar nSubreportHeader=1;

and set the suppression of section B to:

global numbervar nSubreportHeader=0;

Hope that works for you.
|< /\ '][' ( )
IP IP Logged
PongGod
Newbie
Newbie
Avatar

Joined: 10 Jan 2012
Online Status: Offline
Posts: 2
Quote PongGod Replybullet Posted: 11 Jan 2012 at 4:36am
Thanks, FrnhtGLI.  Based on my past experience with Crystal, I suspected some sort of hack like this might be necessary, but it definitely did the trick!  It turn out to be a bit simpler in the sense that I didn't need to split the page header into multiple sections.  I just referenced the global variable in my formula and used an If-Else condition to determine the appropriate text to display.

- Robert -
IP IP Logged
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