• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 438
  • Last Modified:

Conditionally Printing the Report Footer

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.
  • 2
1 Solution
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.

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

mrobersonAuthor Commented:
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 ?    
As far as I'm concerned, if you found the answer on your own, I don't need any points.


Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now