Repeat header when footer by itself - crystal-reports

I'm looking for some help getting a group header to repeat when the group footer is by itself on the last page. On my report, this group header is in the 4th group. The group footer is a grand total that is in the 3rd group.
Sometimes, the records are such that everything in group 4 is on a single page, but the grand total line in group 3 winds up on the next page all by itself. If that happens, I want to be able to reprint the group header from group 4 prior to this final group 3 footer.
Thanks!

Related

How to suppress a blank page at the end of a Crystal Report group

I have a rather complex Crystal Report that is displaying a blank page at the end of each group. This is an issue as my customer requires the next group to start on the next page without a blank page in between.
The report has four groups; the blank page appears at the end of each Group 1. Group 1 has four sub-group headers that dynamically display on a page given an employee's group. There is one group footer for Group 1.
I do know it is not an issue of the details page bleeding into the next page and falsely creating a blank page; this is consistent with each Group 1.
Solutions I have tried:
I have de-selected the option to display a "New Page After" in both the Section Expert and the Group Expert, just for Group 1 (as this is the group causing the issue).
Also added a formula to the Group 1 footer to the "New Page After" formula to display Not(OnLastRecord); the blank page remains
Tried selecting and de-selecting the "Keep Together" options, in both the Section Expert and Group Expert
Some of these solutions switch the blank page to the start of Group 1. I have dynamic paging for each employee, and can see that page 1 of 4 for the first employee in each group is blank.
I am at a total loss here; all of my normal strategies for grouping logic have not worked. Also attempted each of these suggested with no luck:
http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16733
Crystal Reports 11 - Useless blank page is added with just group headers that have data
https://answers.sap.com/questions/4160531/a-blank-page-appears-after-the-group-header.html
Posting the answer for those building complex Crystal reports and troubleshooting this issue: the "Keep Together" option was selected for Group 2, which was adding in the extra page for the first person in each Group 1.

How will I repeat group header of same group where I only want to repeat the second portion of the group?

Here you can see the report. Here you can see the header that is Material Name and so on. Now I want to repeat that header on each page without repeating the details above the Material Header table.
]4
Here the group by is implemented using one attribute. That is why when I changed the second subgroup to Repeat group header on each page it also keeps repeating the details above the material header table. I want only the material table header to be repeated.
To repeat only a part of a group header there are (at least) two different approaches:
multiple (sub-)header on a group and suppressing the unwanted header
multiple, identical groups, repeating only some of them
To use multiple group header:
Create a group a field (PONo) in your case).
Check Repeat Group Header On Each Page in the Group Options in the Group Expert.
Create group headers for the group (#1a and #1b in your case)
Add a Suppression Formula for the group header that should not repeat (#1a), put InRepeatedGroupHeader in the formula body
This will print both group header when a group is printed first but only group header #1b on following pages.
To use multiple groups:
Create two groups on the same field (Group 1 and 2 on PONo)
Check Repeat Group Header On Each Page only for group 2
This will print both group header when a group is printed first but only group header #2 on following pages.

Repeat group header even after footer bleeds over

My group header is set to repeat on each new page. My details section follows it and the group footer has a subreport. On some pages, the subreport flows onto the next page - so the group header will not display before the rest of the subreport.
How can I display the group header even after a subreport break?
You can do this if you use two groups and place your subreport into the group footer of the second group.
Create a second group (for the same field as used in group one)
Configure group header 1 so that it will be repeated on every page (in group assistent, i don't know the english option name)
use group header 1, suppress group header 2
put the subreport in group footer 2, suppress group header 1
If you subreport bleeds over (in group footer two) group header 1 will be repeated.
Hope this helps.

Crystal reports: how to conditionally suppress sections

I am having difficulty suppressing a group header if another group header is blank/suppressed.
Originally I had a layout as follows:
Group Header a - contains client details
Group Header b - contains a subreport that showed details of the incoming calls from client that were received in the last 24 hours.
If the sub report in group header b was blank (because no calls had been received in the last 24 hours), my report was still showing the client details in group header a.
I can suppress the group header b section if the subreport is blank, but cannot work out how to suppress group header a if group header b is blank/suppressed.
After reading various other discussions, I understood that if you want to suppress a section when a subreport is blank, then the subreport would need to be in a section before the section you want to suppress.
So, I changed my layout as follows:
Group Header a - contains sub report showing details of calls in last 24 hours (sub report is suppressed if blank, and group header a is suppressed if blank)
Group Header b - contains client details
Group Header c - contains same subreport showing calls received in last 24 hours
So what I now need to work out is, how do I suppress group header b and c if group header a is suppressed?!
Any help would be greatfully received.
You will need to check record count of sub report, if it is zero then suppress the group using conditional suppress formula. So basically in your group query somewhere you must have field which keeps the count of records in sub report.
Right Click on section
Section Expert
Suppress No Drill
Click x-2 formula editor
if {count} = 0 then true else false
Where {count} is the field having total records for that group
Hope this helps you!

Crystal Reports: Display a group section always on 2 pages

I have a Crystal Report with only one group section on it. After the last group footer I use “New Page After” in order to start each group on a new Page. The Details section in my group depends on the data that comes from the database, so the whole group can sometime take 1 or 2 pages. Theoretically it can take more than 2 pages too. But with the current data the maximum of pages are 2. The new requirement is now to always use 2 pages for each group even if the data in the group does not require a second page. If this is the case, then the second page should be empty (at least the group part of the page).
How can I achieve this with Crystal Reports?
You can achieve it as:
Split your Group Footer, after which you want a blank page, into two sub-sections e.g. Group Footer a, Group Footer b.
To insert a sub-section: open Section Expert, select Group Footer and then click on Insert button.
Create three Formula Fields named as ffReset, ffIncrement and ffCurrent and set their values as:
ffReset:
WhilePrintingRecords;
numberVar counter:=0;
ffIncrement:
WhilePrintingRecords;
numberVar counter:=counter+1;
ffCurrent:
WhilePrintingRecords;
numbervar counter;
Place ffReset in Group Footer b sub-section and ffIncrement in top level Group Header section
Enable / check New Page After option of both of theses sub-sections (i.e. Group Footer a and b) in Section Expert
Set suppression formula of New Page After for Group Footer b sub-section as:
if {#ffCurrent} < 2 then true
Ensure that Suppress Blank Section is unchecked for Group Footer a and b
If required, to disable insert blank page at the end of the report set suppression formula in New Page After as Not OnLastRecord for Group Footer a sub-section only
To repeat Group Headers on every page you may also need to enable / check Repeat Group Header On Each Page option in Group Expert