Is it possible to suppress Group header in page 3/8 when group header no record in this page.
问题:
回答1:
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.
回答2:
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.
回答3:
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})