Solved

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

Posted on 2009-04-10
11
508 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
Comment Utility
It is late evening EST.  I will check in on Saturday morning.
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
Comment Utility
Thank you for reply.  I will test on Tuesday, and return results.  I have been ill on Monday.
0
 

Author Comment

by:bangel
Comment Utility
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
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:bangel
Comment Utility
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
Comment Utility
Global Stringvar GroupHeaderPrinted;
if GroupHeaderPrinted ="YES"
then TRUE
else FALSE

Are any of the sections SUPPRESSED?

mlmcc
0
 

Author Comment

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

Accepted Solution

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

mlmcc
0
 

Author Comment

by:bangel
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

7 Experts available now in Live!

Get 1:1 Help Now