Print Page | Close Window

Suppress Group Header when no details

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1023
Printed Date: 02 May 2024 at 11:35pm


Topic: Suppress Group Header when no details
Posted By: jprucha
Subject: Suppress Group Header when no details
Date Posted: 18 Jul 2007 at 7:48am
Hi All,
 
I need a way to suppress a group header when all of the details in that group are suppressed.
 
I have two details sections in the group and I am conditionally suppressing them based on some calculations on fields in the details section.  It would be simple but there are multiple details as the details represent a specific quarter in time and I'm doing all quarters (financial reports).  So basically I know that I am suppressing a specific details section but is there a way to keep track if I have all details sections (quarters) suppressed which means I don't want to show this groups group header?  Also, I want the report to work not knowing how many quarters there are to be reported.  So I could be doing 20 quarters or 2 quarters and I need to suppress the group if all 20 or all 2 quarters are suppressed.
 
Thanks,
 
 


-------------
Jim



Replies:
Posted By: rnareshk
Date Posted: 19 Jul 2007 at 5:17am
use a same suppressed condition that is used for suppressing the fields of details section, for group header suppress condition.
 
 


-------------
Thank You,
Naresh.


Posted By: BrianBischof
Date Posted: 19 Jul 2007 at 11:40am
In the group header, I would copy all those conditional formulas into one big formula and disable the header. This way, if all conditions are true (meaning every details section will be surpressed), then the header gets suppressed as well.

As an optional step, you could also put each condition into its own formula that returns True or False. Then you can call the appropriate formula from the section. This keeps you from duplicating code in the sections and group header.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: jprucha
Date Posted: 19 Jul 2007 at 12:04pm
Hi Brian,
 
We are on the same track as I do have all 5 (there are five conditions) in my details section in their own formula and that is how I suppress the details section for a specific period.
 
The problem I am experiencing is my group, which is a set of 70 banks, and the group has just 1 detail section.  Each detail section represents a financial quarter.  And I'm showing all quarters so I have an X number of quarters/details sections.  I am keeping track of whether to show the details section like you have said and that is working fine.  Only problem is the Group header shows.
 
If I have 20 periods, how can I keep track of the possibility of all details sections/periods being suppressed for each group.
 
Is there a way to test all details sections to see if they are suppressed?  Might be kind of hard since I don't know the exact number of periods that will show and it will increase as time goes by.  I tried keeping a global counter so that if I didn't suppress a details section that I add to the counter.  But I must not have increased the counter correctly as it never incremented.  I was hoping that at the end of processing that I could check to see if I had a zero for the number I didn't suppress and then I could not show the group header.
 
Any thoughts?
 
Jim


-------------
Jim


Posted By: BrianBischof
Date Posted: 19 Jul 2007 at 12:13pm
Yeah, this is tough one. I would try to build a SQL statement which summarizes the quarters used and have it return a SINGLE record with a field for the data you need. Then you can call the stored procedure (or Command object) from your report and reference each field (type of Boolean?) in the header section. A bit tricky, but if you can figure out how to build that SQL statement then it should work.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: bond_003
Date Posted: 17 Jul 2009 at 6:41am

am new to crystal reportsOuch, please guide me how do i hide group header, page header when no details are present.

Thanks.
RP


Posted By: vike
Date Posted: 14 Oct 2009 at 5:19pm
were you able to solve this? I am running into same isuue and can't find a solution.


Posted By: DBlank
Date Posted: 15 Oct 2009 at 7:23am

NOt sure how you have your report set up but here is a possible solution.

Create a formula field to run through your suppressing options and make a 1 or 0... (0 =suppressed and 1 = not suppressed)
if SuppressionCriteria_A_met or SuppressionCriteria_B_met  or SuppressionCriteria_C_met then 0 else 1
Now you can sum this formula field at group level and use that SUM for your conditionally grioup header suppression
Sum ( mailto:%7b@FormulaOf_1_0 - {@FormulaOf_1_0 }, {table.groupfield})=0


Posted By: Racer3822
Date Posted: 12 Nov 2010 at 9:22am
This solution worked very well for a very similar problem I was having with details displaying.  Thank you!

Originally posted by DBlank

NOt sure how you have your report set up but here is a possible solution.

Create a formula field to run through your suppressing options and make a 1 or 0... (0 =suppressed and 1 = not suppressed)
if SuppressionCriteria_A_met or SuppressionCriteria_B_met  or SuppressionCriteria_C_met then 0 else 1
Now you can sum this formula field at group level and use that SUM for your conditionally grioup header suppression
Sum ( mailto:%7b@FormulaOf_1_0 - {@FormulaOf_1_0 }, {table.groupfield})=0


Posted By: flower
Date Posted: 02 Jul 2012 at 10:56am
Thank you for this answer. It worked !!!!!!!!!!Big%20smile


Posted By: phongtieutu
Date Posted: 29 Oct 2012 at 6:22pm
Hi everybody!
I'm a newbie and i met the same trouble in my reports
My group is grouped by KIND and detail suppress condition is: "({table.orderReq} <> 0) and ({table.orderSel} = 0)"
I want to suppress group header when all detail of a KIND were suppressed
Anybody can help me how to solve this??

Sorry because my Enlish nor well!
Thanks alot for any support


Posted By: DBlank
Date Posted: 30 Oct 2012 at 3:38am
create a formula to set a flag for the rows you want to count
//FlagCounter
if NOT({table.orderReq} <> 0) and ({table.orderSel} = 0) then 1
 
sum this at the group level
sum(@flagcounter,groupfield)
use this summary to suppress the group header
sum(@flagcounter,groupfield)=0



Print Page | Close Window