7
votes

I'd like to suppress a page header if the page has no data records.

Notes

  • The page may still need to display in order to show the group or report footers.
  • I'm interested in the case where there are no records for the details section of the report for the current page. I'm referring to a situation where all details records have been displayed for a group, but the group footer wraps to the next page.
5
Do you mean, if the page has no Details section rows showing on it, or if no data records have been returned for the entire report? The former is quite different to the latter - for example, I wouldn't expect to see group footers on a report with no data, as the groups are defined by the data.user359040
For the former, the only scenario I can think of is if he has "New Page After Group Footer" turned on, and by virtue of the record row heights, there are no Detail sections showing for a certain page. All you would end up with is the Page Header and the Group Footer. I can't wrap my head how you would check for that, though.LittleBobbyTables - Au Revoir
Edited for clarificationBrian Webster

5 Answers

7
votes

Assuming you have Keep Together checked for the group footer, try entering the following in the conditional suppress formula for the page header section in the section expert:

OnLastRecord or {GROUP FIELD NAME} <> Next({GROUP FIELD NAME})

where {GROUP FIELD NAME} is the name of the grouping field.

OnLastRecord must come first in the formula, because if the last page of the report has no detail records (so that the page header should be suppressed), then Next({GROUP FIELD NAME}) evaluates as NULL and all conditions that come after it are also evaluated as NULL.

7
votes

First, you have to create a formula. Then, insert it into to the Details section. For example @VariableA

Inside the formula, put this:

Shared NumberVar PageofLastField;

If OnLastRecord then PageofLastField := PageNumber;

Suppress formula.

The formula checks if the record is the last record. If it is the last record, it saves the Page Number where the last record is to the shared variable PageofLastField. Then on the Suppress formula of your header, put this code:

Shared NumberVar PageofLastField;

PageofLastField := PageofLastField;

if pageofLastfield <> 0 and PageNumber > PageofLastField
  THEN TRUE
ELSE FALSE
2
votes

Right-Click Page Header Choose Section Expert "Suppress (No Drill-Down)" is not Checked But add this formula: pagenumber = totalpagecount

0
votes

To check if details section is empty or not,you can use following statement in suppress formula of section which you want to hide

if(NextIsNull(EnterFieldofNextSectionHere)) then
true
else 
false
0
votes

Insert a summery count for any field

Suppress formula.

IF Count ({table1.field1})=0
  THEN TRUE
ELSE FALSE