Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress Group Header B if Group Header a is blank

Status
Not open for further replies.

B_Shaw

Technical User
Feb 18, 2017
2
GB
I am having difficulty suppressing a group header if another group header is blank/suppressed.

Originally I had a layout as follows:

Group Header a - contains client details
Group Header b - contains a subreport that showed details of the incoming calls from client that were received in the last 24 hours.

If the sub report in group header b was blank (because no calls had been received in the last 24 hours), my report was still showing the client details in group header a.
I can suppress the group header b section if the subreport is blank, but cannot work out how to suppress group header a if group header b is blank/suppressed.

After reading various other discussions, I understood that if you want to suppress a section when a subreport is blank, then the subreport would need to be in a section before the section you want to suppress.

So, I changed my layout as follows:

Group Header a - contains sub report showing details of calls in last 24 hours (sub report is suppressed if blank, and group header a is suppressed if blank)
Group Header b - contains client details
Group Header c - contains same subreport showing calls received in last 24 hours

So what I now need to work out is, how do I suppress group header b and c if group header a is suppressed?!

Any help would be greatfully received.
 
1. In Report Footer of GHa subreport place the following formula:
Code:
WhilePrintingRecords;
Shared NumberVar sCNT;

If      ISNULL(COUNT({Table.CallID}))
Then    sCNT := 0
Else    sCNT := COUNT({Table.CallID});

sCNT
2. Suppress all sections in subreport
3. Format subreport to "Suppress if Blank"
4. Format section GHa to "Suppress Blank Section"
5. Format sections GHb and GHc to Suppress based on the following condition (click on x+2 button and add):
Code:
WhilePrintingRecords;
Shared NumberVar sCNT;

sCNT = 0

Ope this helps

Regards
Pete
 
Hi Pete,

Many thanks for your reply.

Unfortunately it hasn't worked for me. I tried something similar (although not as neat!) and I experienced the same problem. When I look at the results in the subreport footer, it is not recognising when there are no calls and giving it a value of zero. It is counting when there are calls, but not when there isn't.

I have attached a screenshot of what it looks like if that helps? I have taken unsuppressed GHa and you can see that for the 'wardens handset' call it is finding a count. The fire alarm doesn't have any calls, but it is not counting as zero in GHa for that one.

Do you have any further ideas about what else I could try?

Kind regards

Becki
 
 http://files.engineering.com/getfile.aspx?folder=b517f0f5-d9f5-40a2-bde4-3cc721d4b982&file=Report_screenshot.docx
Hi Becki

Not sure what to suggest. I tested my approach and it definitely worked, but obviously it depends on determining when there are no calls. The screeshot doesn't really help, and I am not familiar with your data. My approach relies on the fact that no calls means no records and a null count. I need to understand what really indicates no calls.

If you are happy to post a copy of the report with saved data and explain what factor determines no calls, I'm happy to take a look.

Regards
Pete
 
Try adding a group section above GHa that establishes the value of sCNT as 0. Then in the subreport change the formula to:

If count(table.callID)>0 then
SCNT := count(table.callID)

Then use sCNT = 0 to suppress the client details section. Be sure to identify sCNT as a shared variable throughout.

-LB
 
Do you have the subreport limiting data to only the calls related to the Customer Group from the main report (by linking the subreport to the main report on Customer ID or similar)?

If not, that would result in the subreport always returning call volumes that would cause the recommended approach to fail.

Regards
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top