Conditionally Printing the Report Footer

Posted on 2006-05-24
Last Modified: 2008-02-01
I have a report where
Group #1 Header  - Prints  the persons last name  plus a formula for initializing a counter to zero the formula is suppressed
Group #2 Header – is suppressed
Group #3 Header – is suppressed
Detail A – is suppressed
Detail B – is suppressed
Group #3 Footer – Displays the data for the report
Group # 2 Footer – is suppressed
Group #1 Footer – displays the summary totals – Prints a new page after – a formula for incrementing the counter
Report Footer – displays Grand Totals

What I am trying to accomplish is at the end of a report if there is room on the next to last page of the report  to print the grand totals instead of having them print at the top of a new page what would be the last page. The conditions for this would be when the Groupnumber for Group #3 is less than 20 and Groupname  for Group #1 is blank or there are no more Group #1 left

In the section expert I have tried a number be conditional formulas in the New Page After attribute for the Group #1 Footer. No, I do not have the checked boxed checked.
Question by:mroberson
    LVL 100

    Expert Comment

    HOw about trying it this way

    Don't use NEW PAGE AFTER on the group footers.

    That way if there is room on the page it will be printed if not then it will appear on the next page.

    LVL 34

    Expert Comment

    So, you don't want a new page after the last group 3 if there were less than 20 of them, and you already have some kind of counter set up for group 3?

     When you say "Groupname for Group #1 is blank", can the group name actually be blank, or is that tied to the "no more Group #1 left" condition?  Assuming the latter, how about a New Page After formula like:

     Not OnLastRecord OR Groupnumber >= 20


    Accepted Solution

    I came upon the solution late yesterday & finished the testing this morning , the professional in me tells I should claimed to have found it thru due diligence  research and testing but it came about by fat-fingering typing in the menagerie of code that had collected in SECTION EXPERT for the Group #1 Footer
    The solution is

    This is all of the code that is need in order not to have the grand totals orphaned on a page by themselves This is in the formula area (x-2 button) for the  NEW PAGE AFTER  attribute  leaving the check box unchecked. No GROUPNUMBER counter either.

    Mlmcc – the KEEP TOGETHER  attribute  defaults to check – I do not remember if this default value  is shipped like this or not – anyways the end user wants Group #1 Header to print at the top of a new page  and also asked not to have the grand totals orphaned. Thx for the assist.

    James – I was attempting to find a way to use the function GROUPNUMBER for a specific group, in this case Group# 3 Footer, in a different Group e.g. Group #1 Footer So I had a Counter formula using the function GROUPNUMBER in place of an incrementing formula.
    For whatever reason, in the X-2 formula area of the Section Expert the Combination of NOT(ONLASTRECORD) AND GROUP3Counter > 18  along with NOT(ONLASTRECORD) OR GROUP3Counter > 18  even tried different way of working
    ONLASTRECORD AND GROUP3Counter < 19 plus variations on
    GROUPNAME (<formula used>) = “” OR ISNULL(GROUPNAME(<formula used>)) AND/OR  GROUP3COUNTER  > 18

    I went as far as testing with IF THEN DEFAULTATTRIBUTE

    I was not getting the results the end user is currently asking for in fact in most cases  the CR would not even get the NEW PAGE AFTER let alone not orphan the grand totals IF I got the NEW PAGE AFTER I would have orphaned grand totals If the CR NEW PAGE  AFTER did not work then no orphaned grand totals.

    There is some other variations of code that was tested and did not produces the correct results

    Thx for the assist sorry bout the long follow-up

    Mlmcc & James0628 – what is the fair way to close this out ?    
    LVL 34

    Expert Comment

    As far as I'm concerned, if you found the answer on your own, I don't need any points.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now