Solved

Display Group Header when only the Group footer is the content for the page

Posted on 2009-04-10
11
513 Views
Last Modified: 2013-11-15
I have a report where a group can overflow to more than one page.  There are instances where the overflow to the next page consists of only the group footer (which are the totals for the group).  When this occurs, the group header is not repeated at the top of the page  even though I have specified "Repeat Group Header on Each Page" in the Group Change Properties Box.  
My question has been answered before by cojo1976 some time ago.  The solution was resolved via  the author pasting a link that I do not have access to,  or the link is is dead.  
From the old post:  05/02/06 08:29 PM, ID: 16592309;  http://www.experts-exchange.com/Q_21833586.html
   " I found the solution in one of the questions posted in 2002 by cojo1976
   "Group Header not printing".    The solution directed reader to a Crystal Report site
   http://support.crystaldecisions.com/library/kbase/articles/c2004981.asp.
     I've tested it and it worked."

Can you help again, by pasting the actual solution  in text?  I have found numerous requests about this "feature"  but no actual resolution.  I suspect there may be not  actually be a true work-around for this feature, so I pose the question to the Experts.  

I do not want to move my group headers to a page header, because, I have logic in the group headers, and the page header section is shared with sub-reports.   (Crystal Reports XI Release 2)
0
Comment
Question by:bangel
  • 7
  • 4
11 Comments
 

Author Comment

by:bangel
ID: 24120732
It is late evening EST.  I will check in on Saturday morning.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24126852
I can't think of a straight forward way to do this.

One idea
Add a new group footer
   Right click the group footer in the left margin
   Click INSERT SECITN BELOW
Drag the new group footer to up to make it GFA
Copy the group header to it

Add a formula to the report header
WhilePrintingRecords;
Global BooleanVar GroupHeaderPrinted := False;
''

Add a formula to the group header

WhilePrintingRecords;
Global BooleanVar GroupHeaderPrinted;
GroupHeaderPrinted := True;
''

In the page footer
WhilePrintingRecords;
Global BooleanVar GroupHeaderPrinted;
GroupHeaderPrinted;
''

mlmcc
In the GFA section espert
Click the formula button to the right of suppress
WhilePrintingRecords;
Global BooleanVar GroupHeaderPrinted;
GroupHeaderPrinted := True;
''

0
 

Author Comment

by:bangel
ID: 24134059
Thank you for reply.  I will test on Tuesday, and return results.  I have been ill on Monday.
0
 

Author Comment

by:bangel
ID: 24143353
I have been testing this, and not getting the results I had hoped for.  
I like the approach, set a var, then test in the suppress condition.
I am new to CR.  
1.)  How does the WhilePrintingRecords work?
2.)  Is the global booleanVar statment declaring the var each time?
        (can't  seem to test/asset  w/o it)
3.) If I can set a var when the group_header is printed , and test in the supress property/condition of the NEW GFa , I may be able to make this work.  

4.)  I know this a feature or CR,  most other reportWriters handle this conditon, (rant over)
 Bangel
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24144382
Crystal is a little different from other languages.

WhilePrintingrecords;
Tells Crystal when to evaluate the formula.  Crystal uses a multiple pass method when building a report.  The Printing Pass (WhilePrintingRecords) is the final pass before the report is displayed.

Variable declaration
Variables are only "visible" if declared in te formula.
Using Global makes the variable available to the entire report but you still need to "declare" it in the formula.
One reason is that during the first couple of passes no record is kept of the variables in use so if a formula gets evaluated in that pass then Crystal needs to declare the variables.

mlmcc
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:bangel
ID: 24147680
Thank you sooo much for your response.  I need clarification:

"Variables are only "visible" if declared in the formula.  
Using Global makes the variable available to the entire report
but you still need to "declare" it in the formula.  
One reason is that during the first couple of passes no record is kept
of the variables in use so if a formula gets evaluated in that pass
then Crystal needs to declare the variables."

If we are declaring the var in each section again,
how can we test it in the following section?  

I want to set to gphprinter = yes, then test it in the
gphfooter section so I know if it has been printed
 on that page, and if I am declaring it again, has it lost it's value from prior section?

Are we saying that the variable do not have
state or scope outside of the section they are declared in?

 

example of my possible solution:  (thanks to you)

1.)  pageHeader  var='newpage
2.)  groupHeader var="printed'
3.)  groupFooder suppressCondition(if var='printed' then print me)
4.)  pageFooter  var="bottomofpage"

I'm finding that in the suppressCondtion step that  the var is is "printed" even when it hasn't",
(sort of like the pageFooter is not really setting the var"  

Does the var hold state across the page?

Thank you


code snippet:
------------------------------------------
//groupHeaderfmla
WhilePrintingRecords;
Global Stringvar GroupHeaderPrinted;
GroupHeaderPrinted :="YES";
------------------------------------------
//PAGEFOOTER   and PAGEHEADER
//needs to set the var to 'no',
WhilePrintingRecords;
Global Stringvar GroupHeaderPrinted;
GroupHeaderPrinted :="DONEPRINTING";
-------------------------------------------
//SUPRPRESS CONDTION --GROUPFOOTER GH1A
//WhilePrintingRecords;
//Global Stringvar GroupHeaderPrinted;

if Global Stringvar GroupHeaderPrinted ="YES"
then TRUE
else FALSE
-------------------------------------------

I'm finding it really does not matter what I check in this condition,
the GroupHeaderPrinted  variable doesnt' seem to be a real variable.  


0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24149594
Global Stringvar GroupHeaderPrinted;
if GroupHeaderPrinted ="YES"
then TRUE
else FALSE

Are any of the sections SUPPRESSED?

mlmcc
0
 

Author Comment

by:bangel
ID: 24153694
there are 'other sections' that are supressed.  page header, detail section for example.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24153879
If a section is suppressed the formuas may not be executed.

mlmcc
0
 

Author Comment

by:bangel
ID: 24156901
I think that is the case here.  I can see the varables being set, and how they change.  When the var is evaluated in the supress condition, it just does not affect the behavior, i.e. not suppressing.

I have convinced the customer to accept a change in requirements, and simply moved each groupfooter to a new page.  No orphaned footers, however the page covererage is not exactly what we had hoped for when there is a group section with few items.  

Thank you.
0
 

Author Closing Comment

by:bangel
ID: 31569133
Since we were trying to 'work around' a feature  we could not have expected much.  It would have been nice to see what was  actually in the solution suggested in the link referred to in my original post.  Overall, I'm fine with the outcome.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now