Stop New Page After when parent group changes - group-by

In Crystal Reports, Group 1 is currency and Group 2 is GL Account. I want a new page after each GL Account but at the end of Group 1, I want the Group 1 footer to display on the last GL Account page instead of going to the next page. Setting New Page After on the Group 2 footer section works but I need a condition so a new page is not added when the Group 1 footer prints as the next section.
Group 1 Header: CAD (New Page After - X-2: Not on first page)
GL Acct 1 (New Page After)
<NEW PAGE>
GL Acct 2
<NEW PAGE>
GL Acct 3 (Stop New Page After)
GROUP 1 Footer: CAD
<NEW PAGE>
GROUP 2 Header: US... etc
I tried New Page Before on the Group 2 header (except on the first page) but I need the Group 1 header to print on the same page as the first Group 2 record later on in the report.

"when the Group 1 footer prints as the next section" could be translated into a formula like this:
If {Group 1 field - probably currency} <> Next({Group 1 field - probably currency}) Then True Else False

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.

Repeat header when footer by itself

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!

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: 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

In Crystal Reports I am looking to have a header footer then header footer with linked info but different Sums

So I know it is not possible to do
header 1
detail
footer 1
header 2
detail
footer 2
But I am trying to make a form that shows
Invoices
Invoice#, Date, Status, Total, Balance Due
Info
Debits total:
Credits
Date, Reference, Total, Balance
info
Credits Total:
Balance due:
Balance due being debits - credits. I was able to get the invoices but I can not figure out how to get the Credits to show below the debits total.
Edit------------------------------------------------------------------------
Help with the below requirement aswell:
sum(case when s.[ar sale bill to] like '%wilco%'
then isnull(d.[ar saled qty requested],d.[ar saled qty]) * d.[ar saled unit price]
else 0 end) as 'Total'
I need to have a value if it is null grab to qty from [ar saled qty] any ideas?
Now I am having trouble with getting it on the same page...Detail 1 prints on page one and Detail 2 Prints on page 2. The amount of records vary but on the first record there is 3 lines in the first subreport and 1 in the second subreport.
Why don't you just separate the Debits vs Credits using a Group of Invoice Type.
That way you can just add a summary of the balance on the group footer. It should serve your purposes.
your requirement is definitely possible....
Use two sub reports in single main report where you can get desired structure
header 1 //sub report 1
detail //sub report 1
footer 1 //sub report 1
header 2 //sub report 2
detail //sub report 2
footer 2 //sub report 2
Let me know incase any issue
I figured out my report on separate pages. I was looking in the section expert and all the keep together's where checked so i knew it had to be a formatting issue. I went in and suppressed all the fields that i was not using in the subreport like report header/group header instead of just making the sections as small as they could go and that did the trick.