Solved

Crystal Reports Selective Grouping

Posted on 2007-04-05
5
479 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now