Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Suppressing a group Post Reply Post New Topic
Author Message
voldo37
Newbie
Newbie


Joined: 07 Mar 2012
Online Status: Offline
Posts: 2
Quote voldo37 Replybullet Topic: Suppressing a group
     Posted: 07 Mar 2012 at 11:07am
I am having problems trying to suppress a group and I am just not that experienced with CR so this just doesn't make sense to me why it won't work. I have two groups and depending on a parameter that gets passed to the report I want to suppress the outer group - not group the data.  The problem is that it is only suppressing the header and footer sections but the data still appears grouped. 

Here is an example.  Lets say I pass in a "Y" then I want to see the report like this where I have an outer group called Machine Type and then inside of that I have all the retailers that have machines of that type.
Machine Type1
  Retailer1
          Machine1    Serial#
          Machine2    Serial#
       Retailer Totals:
  Retailer2
          Machine1    Serial#
          Machine2    Serial#
       Retailer Totals:
  Machine Type1 Totals:
  
Machine Type2
  Retailer1
          Machine3    Serial#
          Machine4    Serial#
       Retailer Totals:
  Retailer2
          Machine3    Serial#
          Machine4    Serial#
       Retailer Totals:
  Machine Type2 Totals:


If I pass in a "N" then I don't want the data grouped at all by the Machine type and want to see all of the data grouped just by the Retailer like this:
  Retailer1
          Machine1    Serial#
          Machine2    Serial#
          Machine3    Serial#
          Machine4    Serial#         
       Retailer Totals:
  Retailer2
          Machine1    Serial#
          Machine2    Serial#
          Machine3    Serial#
          Machine4    Serial#         
       Retailer Totals:

But instead I am seeing this:
  Retailer1
          Machine1    Serial#
          Machine2    Serial#
       Retailer Totals:
  Retailer2
          Machine1    Serial#
          Machine2    Serial#
       Retailer Totals:
  Retailer1
          Machine3    Serial#
          Machine4    Serial#
       Retailer Totals:
  Retailer2
          Machine3    Serial#
          Machine4    Serial#
       Retailer Totals:

In the Section Expert I have the Suppress checkbox checked for the Machine Type group header and footer and then I have a condition specified "Type='N'"

So - what am I doing wrong??
Thanks


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Mar 2012 at 11:31am
conditional suppression just hides a section when your formula evaluates to true it does not hide all section with in a group nor does it make the grouping not exist.
You need to make a formula field that changes the value in itself based on the param you pass in and then group on that formula field
example:
//formula called conditonalGrouping
if param = 'Y' then table.machinetypefield else 'No Grouping'
 
Group1 use @conditonalGrouping instead of table.machinetypefield
Keep your conditional suppression on GH1 the same.
IP IP Logged
voldo37
Newbie
Newbie


Joined: 07 Mar 2012
Online Status: Offline
Posts: 2
Quote voldo37 Replybullet Posted: 08 Mar 2012 at 8:58am
I used a formula like you suggested and it is working - Thanks for your help!!
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum