Print Page | Close Window

"Continued" in Group Header

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=3196
Printed Date: 03 May 2024 at 3:49am


Topic: "Continued" in Group Header
Posted By: Debbie Giles
Subject: "Continued" in Group Header
Date 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



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




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


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




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




Print Page | Close Window