Is it possible to suppress Group header in page 3/8 when group header no record in this page.
-
Did you try to check the option "keep together" in the group's section expert?– heringerJun 20, 2017 at 18:08
-
Yes, i try but it not working. It still same.– Athit UpakanJun 20, 2017 at 18:20
-
Sorry, i mislead you, that is not how keep together works. It keeps the section together, and not the group+details.– heringerJun 21, 2017 at 12:32
3 Answers
Here it goes a solution for the problem, but you will have to adjust something else to keep the group header repeating for each page.
The main idea is to simulate the group header as a detail section and show it only together with the first record of the group.
Step by step:
- Create a running total field to count the records in your group: field to summarize = any, type of summary = count, evaluate for each record, reset on change of group. Let's assume the name of this formula is {#RTotal0}.
- Suppress your group header.
- Create another detail section above your current detail section. So, you will have "Details a" and "Details b". The section "Details a" will simulate the group header.
- Open the section expert, choose the section "Details a", open the formula editor for the option "Suppress", and put this formula:
{#RTotal0} > 1
. That means that this section will be shown only for the first record of the group. - Open the section expert, choose the section "Details" (the parent of "Details a" and "Details b") and check the option "keep together".
This will solve your problem. But know the group header will not repeat for each page. One way to do that:
- Open the section expert for the group header option, open the formula editor for the option "Suppress", put the formula:
{#RTotal0} = 1
. It means that the group header will suppress initialy, but after a page break, it will show (if you the group is set to print the group header for each page).
But you may need to adjust it for your case.
Try Group Expert/Options/Options Tab and check Keep Group Together. If this does not work, I would add a count formula to count records in that group, and suppress group if that count is zero.
-
When I tried keep group togerher in group expert, All group print in new page if records in that group not enough to print all records in this page. And i tried count record in group that group in page 3/8 has 1 record(reccord number same page4/8) then it not suppres Jun 21, 2017 at 0:21
-
-
This is a feature that I forget about often because of its odd navigation. This particular answer worked me in this case to keep my Group Header 2 together.– SunMay 14, 2019 at 19:16
I found a guide that shows how to prevent orphaned headers. Have a look method 2 of it.
The idea is that you setup a group header that acts as a detail section, but only for the first row of each group. On that first the detail section will be suppressed.
- Add an additional group header for your group B. Now you have a header B1 (your old one) and B2 (the new one).
- Format B2 like your detail section, copy all fields etc.
- In the section expert select the entry for all B headers (not B1 or B2). Tick
Keep together
. Add a formula to the
Suppress
box of your Detail section with the following content (replace{database.field}
with the field by which you are grouping):WhilePrintingRecords; Onfirstrecord or {database.field} <> Previous({database.field})
-
1FYI, answers that just link you to another page are frowned upon at Stack Overflow. (If that page gets removed, the answer becomes useless.) Kudos for citing your sources, but you'll also want to summarize it in your post to avoid getting flagged.– 4444Jun 21, 2017 at 13:45
-
1@4444 Thank you for that tip - haven't thought about. I intentionally did not copy the content to not plagiarise– dd4711Jun 21, 2017 at 13:51
-
thanks, @dd4711 , I added new group but it not work. Then i use heringer 's solution and it worked. Jun 21, 2017 at 14:41
-
-
@dd4711 I tried this solution again and it work thanks you very much.:) Jun 27, 2017 at 3:31