Solved

Crystal Reports Selective Grouping

Posted on 2007-04-05
5
494 Views
Last Modified: 2008-07-29
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
0
Comment
Question by:nebest
5 Comments
 
LVL 8

Expert Comment

by:MOA81
ID: 18859084
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
0
 

Author Comment

by:nebest
ID: 18859531
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
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 18859630
2 ideas
First group on a formula rather than the database field

Name - MyGroup
Formula
If ({?YourParam} = "GRP)") then
   ToText({YourDateField}, "yyyy-mm-dd")
else
   {ItemField}

Second group
Name - MyGroup2
Formula
If ({?YourParam} = "UNGRP)") then
   {ItemField}
else
    "1"

The second method is to change thegroups from the application
http://support.businessobjects.com/communityCS/FilesAndUpdates/SCR8_VB_RDC_GroupSort.exe.asp


mlmcc
0
 
LVL 22

Expert Comment

by:Ido Millet
ID: 18859791
I don't think you need the 2nd level grouping in the instructions provided by mlmcc.  
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18860647
Glad i could help

mlmcc
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal Reports remove alpha characters only 5 55
Crystal - variable evaluate after with criteria 4 59
Crystal Reports 13 5 71
Crystal Reports total formula with groups? 4 56
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question