cancel
Showing results for 
Search instead for 
Did you mean: 

Supressing a sub report when there is no data input

Former Member
0 Kudos

I have a sub report in the Report Footer of the main report. I have selected to suppress the subreport when it is empty.

But, I have a formula in the details section of the subreport which calculates the item number:

WhilePrintingRecords;

Shared Numbervar x;

x:= x + 1;

So, even when there is no data being inputed into the subreport, it still shows up. What would be the best way to supress the sub report when it is empty?

I can think of a couple of options but I don't know how to write formulae for them:

1. The sub report contains a field in the details section called DRAW_NO. So, supress the sup report when there are no entries in this field.

2. Leave the item number blank when there are no entries in the field DRAW_NO.

If anyone can tell me roughly what the formula should look like then I would be very grateful. Or, if you have another suggestion for supressing the sub report when it is empty.

Accepted Solutions (1)

Accepted Solutions (1)

former_member260594
Active Contributor
0 Kudos

Try just modifying your existing formula;

WhilePrintingRecords;

Shared Numbervar x;

if count() > 0 then x:= x + 1;

If there are no records returned then the count will be 0 and no value assigned to the shared variable, thus the blank subreport can be suppressed

Former Member
0 Kudos

cheers. thats exactly what was required

Answers (1)

Answers (1)

Former Member
0 Kudos

There is an option in the section expert called suppress blank sections, check that and see if it works

Former Member
0 Kudos

I have selected that option already.

However, the section isnt completely blank because of the formula which displays a number in the first row of the details section regardless of whether or not there is an item actually in that row.