Print Page | Close Window

Suppress Group Headers

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22709
Printed Date: 27 Apr 2024 at 5:15am


Topic: Suppress Group Headers
Posted By: kris_a
Subject: Suppress Group Headers
Date Posted: 12 Dec 2018 at 3:19am
I have a parameter on my report that allows the user to see 1) orders that have invoiced in the current month and any open orders OR 2) just open orders. The issue is when option 2 is selected - the group headers are still showing for the sections where invoiced orders are being suppressed and there are no open orders. So I just have a bunch of random headers with no data underneath. Is there a way to conditionally suppress these if the group section is blank based on the parameter?



Replies:
Posted By: DBlank
Date Posted: 13 Dec 2018 at 2:42am
create a formula field that returns a 1 or 0 per row based on your suppression criteria (1=show, 0=suppressed)
sum that formula field for the group and use that group sum to conditionally suppress the group header and footer. Anything with a SUM>0 is show else suppress.


Posted By: kris_a
Date Posted: 17 Dec 2018 at 10:28am
Thank you. I created the formula and it is returning the value of 1 or 0 properly, however when I got to sum that formula - the option to Insert Summary is not on the RMC menu. So I tried creating a separate formula that I could place in the group footer and it will not let me sum the formula field through that either because "1" or "0" are not numerical values. I then tried a count and that did not work either. Am I missing something on how to Sum this field?


Posted By: DBlank
Date Posted: 17 Dec 2018 at 10:41am
what is your formula for the 1/0 returned value?


Posted By: kris_a
Date Posted: 17 Dec 2018 at 10:56am
if{?Order Status}="1" then "1"else "0"

{?Order Status} is the parameter field I set up - if 1 is selected on the parameter it shows only orders that are open. 2 returns orders that are open AND orders that have been invoiced in the current month.

I'm having the header issue only with the selection of parameter "1" and it's showing all the headers for all the groups of orders that do not have currently have an open. Hopefully that makes sense.


Posted By: DBlank
Date Posted: 17 Dec 2018 at 11:02am
try and rethink it around the combination of row level data and your param.
What is the condition on the row that determines if it is 'open' or not.
//opencounter
if {table.field} = open criteria here then 1 else 0.

Now you can sum this at the group level
SUM(@opencounter,table.groupfield)
if that sum>0 then your 'group' is open and yo can suppress based on that:
{?Order Status}<> 'Open' and SUM(@opencounter,table.groupfield)>0



Print Page | Close Window