Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: "Continued" in Group Header Post Reply Post New Topic
Author Message
Debbie Giles
Newbie
Newbie
Avatar

Joined: 16 May 2008
Online Status: Offline
Posts: 10
Quote Debbie Giles Replybullet Topic: "Continued" in Group Header
    Posted: 16 May 2008 at 2:31am
I have several groups which span multiple pages and I need to print the word continued on the second page of the group's page or third if the group is continued that far. I thought about adding another group header (group header b)and suppressing it where there is no group header a, but I can't get a suppress formula right.
 
Can anyone help?  Is there a better way of doing this?
 
DebbieCry
Debbie Giles
Syspro Consultant
EOH
+27 21 525 7200
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 16 May 2008 at 4:23am
You don't actually want a group header, because that won't print at any given point on the page (like, say, at the top).  You want to use either the page header or page footer.

The general way to do this is to create a second page header and/or page footer.  Create a global variable.  Create a series of formulas to manipulate the variable, all with WhilePrintingRecords set:
In the Report Header, initialize the variable to 0.
In the Group Header, set the variable to 1.
In the Group Footer, set the variable to 0.
In the "Continued..." page header/footer section, suppress the section if the variable = 0.

In this way, if you get to a page break between a Group Header and a Group Footer, the variable will be 1, which means "Continued..." will be printed.  You will also likely want to tweak the "Keep Together" settings of your sections and groups, to make sure that the pages break in logical places.


IP IP Logged
Debbie Giles
Newbie
Newbie
Avatar

Joined: 16 May 2008
Online Status: Offline
Posts: 10
Quote Debbie Giles Replybullet Posted: 19 May 2008 at 12:26am

Hi Lugh

This makes wonderful sense.  You are a genius, however I do not know how to add a variable to a report.  I see there are variable "operations" which I can add to a formula.  If this is it, which one do you recommend.

Thanks!
Debbie
Debbie Giles
Syspro Consultant
EOH
+27 21 525 7200
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 19 May 2008 at 4:45am
For this kind of operation, it's quite simple.

In Report Header, add a formula field that looks like:

WhilePrintingRecords

Global BooleanVar PageTest := False

(This creates the variable PageTest and initializes it to False, meaning we are not in the middle of a group.)

In Group Header:

WhilePrintingRecords

Global BooleanVar PageTest

PageTest = True


In Group Footer:

WhilePrintingRecords

Global BooleanVar PageTest

PageTest = False


In Page Footer:

WhilePrintingRecords

Global BooleanVar PageTest

IF PageTest = True THEN
    "Continued on next page..."
ELSE
    ""


Just add these formulas to the indicated sections, and it should work.  The only formula that will actually show up on the final report will be the last one, which will show the "Continued..." phrase when the page break comes in the middle of the page.


IP IP Logged
Karthiknathan
Newbie
Newbie


Joined: 28 Jun 2012
Online Status: Offline
Posts: 1
Quote Karthiknathan Replybullet Posted: 28 Jun 2012 at 9:21pm
Why don't we just use the below code to accomplish this above?

IF NOT INREPEATEDGROUPHEADER THEN
    {GroupName}
ELSE
    {GroupName} + ' Continued...'

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.035 seconds.