Link to home
Start Free TrialLog in
Avatar of nebest
nebest

asked on

Crystal Reports Selective Grouping

I am using crystal reports 10.0. I have a report where I inserted a group ... I want to add a parameter where if a particular value is chosen say "grp" then I display the data with the group I created and if the value "ungrp" is chosen I display the data without the grouping.  Is there a way to do this in crystal reports?

Thanks for your help
Avatar of MOA81
MOA81
Flag of Jordan image

create a formula as follows call

if value="grp" then
               the field you want to display
else
if vale="ungrp" then
              all the other fields
end if

and in the section expert check the supress and create a formula to hide the group header if the values is ungrp
Avatar of nebest
nebest

ASKER

MOA81,  I don't think your comment will solve the problem, maybe i didn't state it quite clearly or maybe I don't quite understand your comment.  I am restating the problem below.

Design
------
Group by Date - Header
  Group by Item - Header
     Details (Supressed)
  Group by Item - Footer
Group by Date Footer


Data
----
1.1.2007  1111       Apple      20
1.1.2007  2222       Orange           5
1.2.2007  1111       Apple      15
1.2.2007  2222       Orange       5
1.2.2007  3333       Pears      10



I created a parameter called "Options" and the possible values are "date" and "item"


When I select "date" I expect results looking like


1.1.2007
  1111   Apple      20  
  2222   Orange      5

1.2.2007
  1111   Apple      15  
  2222   Orange      5
  3333   Pears      10


When I select "item" I expect

  1111   Apple      35
  2222   Orange     10
  3333   Pears      10

In the second case, it is as if the group by date never existed and we are only grouping by item.  Is this possible?

How do i achieve this?

Thanks again
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't think you need the 2nd level grouping in the instructions provided by mlmcc.  
Glad i could help

mlmcc