Monday, March 12, 2012

How to suppress the group header session when no record return?

How to suppress the group header session if there is no record return in detail session?
RegardsCreate tow formulae
Formula1 @.Reset having the code
Numbervar c;
whileprintingrecords;
c:=0;
Formula2 @.Count having the code

Numbervar c;
whileprintingrecords;
c:=c+1;
Place Formul1 at PageHeader and Formula2 at Details.
In the section expert of Group header write this code at suppress option

numbervar c;
if c:=0 then true|||Hi

The above solution didn't work for me. However, I think the following should work:

1) Create an additional section above the already existing section(s) in the details.

2) Move the contents of the group header to the newly created section in the details.

3) Suppress the group header.

4) Create a global variable, say @.isFirstRecordInGroup, which you set to true in the group header.

5) Suppress the newly added section in details (which now contains the previous contents of the group header) if @.isFirstRecordInGroup is false. Otherwise, if @.isFirstRecordInGroup is true, don't suppress and set @.isFirstRecordInGroup to false.

In this way, the contents that were previously placed in the group header will now be shown as part of the first detail in each group. Hence, if there are no details, nothing will be displayed.

Admittedly, this hack does not render the report more understandable for other programmers, but it should fix the problem.

No comments:

Post a Comment