?
Solved

Ignore grouping level with a parameter

Posted on 2005-03-21
10
Medium Priority
?
321 Views
Last Modified: 2012-08-14
Hi everyone,

I'm pretty new to Crystal and having a grouping issue.  

If I had 3 parameters for grouping (three levels) and wanted to give the user flexibility to group on only 1 or two levels (therefore selecting '*' from a list in the parameters.

I was wondering if it would be possible then to jump from the 2nd grouping level, right down to the detail levels as they wouldn't want to see the same records in the 3rd level that were in the 2nd level (essentially skipping the 3rd grouping level)

This is the code I've currently got in my parameter for grouping.
??? Is how I imagine the code would look like:

Select {?Group1Parameter}
???    Case "*": NoGrouping
    Case "Territory": {V2PS_Order_Lines_w_Mapping.Territory}
    Case "Order Type": {V2PS_Order_Lines_w_Mapping.Order_Type}
    Case "Product": {V2PS_Order_Lines_w_Mapping.T_PRODUCT_MAPPING}
    Case "Quarter": {V2PS_Order_Lines_w_Mapping.QuarterDisplay}

Thanks
Chris
0
Comment
Question by:loopyadc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 13592978
Where are you wanting to add this code?

Groups in Crystal have headers and footers which you will need to suppress.  Other than that they are essentially sort fields.

I don't believe from the report you can drop a group.  It can be done from an application.
If you do this from Crystal you may need to use the primary Key field as the group.

mlmcc
0
 

Author Comment

by:loopyadc
ID: 13593073
I currently have that code in my parameter values so once the user can dynamically select what they want to group by, and now I want to add the functionality to allow them not to have to use the grouping functionality if they don't want to.

If I could suppress the headers and footers without excluding any records at that grouping level it would be perfect.

I could use the Account_Id field (if parameter = "*" then group by id - none are null) if I could then hide the header and footer and show the detail?
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 1050 total points
ID: 13593740
To hide a header or footer

Open the report
Click FORMAT --> FORMAT SECTION
Select the section
Click the FORMULA BUTTON to the right of SUPPRESS
Enter a formula that is TRUE when you wish to suppress
  {?Group1Parameter} = "*"

mlmcc
0
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.

 
LVL 28

Expert Comment

by:bdreed35
ID: 13593768
You need to create 3 formulas to group on.

Each formula should look at the paramater like in your first post, except you should return an empty string if they choose "*":

//@Group1
Select {?Group1Parameter}
    Case "*": ""
    Case "Territory": {V2PS_Order_Lines_w_Mapping.Territory}
    Case "Order Type": {V2PS_Order_Lines_w_Mapping.Order_Type}
    Case "Product": {V2PS_Order_Lines_w_Mapping.T_PRODUCT_MAPPING}
    Case "Quarter": {V2PS_Order_Lines_w_Mapping.QuarterDisplay}

Also, all cases need to return the same datatype.

So create 2 more formulas called Group2, and Group3.
Base each grouping off of the each of the three formulas.
Next, open the section expert under the report menu.
Highlight Group Header 1 and and then click the X+2 button to the right of Suppress (No Drill Down).
In the editor, enter the following logic:

    {?Group1Parameter} = "*"

Save and Close.
Highlight Group Footer 1 and enter the same formula in the same place.
Repeat the above steps for Group 2 Header/Footer, and Group 3 Header/Footer using the corresponding parameter in the formula.
0
 

Author Comment

by:loopyadc
ID: 13599216
Thanks , I can now suppress the drill down, but I can't get down to my final detail level which I still want to be able to get to?

Essentially I'm trying to skip out one of the grouping levels if the user doesn't want to see it and then get straight to the detail.  If I suppress one of the drill down levels it won't let me go any further.

Is it possible to do this and still get to the detail level?

Cheers
Chris
0
 
LVL 19

Expert Comment

by:GJParker
ID: 13600409
You can't control the drill down functionality with a formula. If you hide any of the group sections you can still double click in the blank space to drill down but you can't miss out the group and go to the next level.

Gary
0
 
LVL 28

Expert Comment

by:bdreed35
ID: 13600513
What version of Crystal are you using?  
This is possible with 9 and above, but not with 8.5 or below.
0
 

Author Comment

by:loopyadc
ID: 13609742
I'm using CR11 Dev
0
 
LVL 28

Assisted Solution

by:bdreed35
bdreed35 earned 450 total points
ID: 13611339
Ok, then give this a shot.

Remove any "Hide Drill Down OK" from any of the group header/footer or details sections.
Now, from the Section Expert, you need set some conditional suppression formulas for the group sections and details section.
For each of the following sections that I list, you will need to highlight that section in the Section Expert, then click the X+2 button to the right of "Suppress (No Drill Down)" and enter the code that I provide.
You may need to alter the spelling of you parameters if need be.
BTW, I am assuming that if an "*" is chosen in Group1, then it will ignore the rest of the parameters and assume that they don't want it grouped at all.

Group Header 1 and Group Footer 1:
    {?Group1Parameter} = "*"

Group Header 2 and Group Footer 2:
    ({?Group1Parameter} = "*" or {?Group2Parameter} = "*") or DrillDownGroupLevel < 1

Group Header 3 and Group Footer 3:
    ({?Group1Parameter} = "*" or {?Group2Parameter} = "*" or {?Group3Parameter} = "*") or DrillDownGroupLevel < 2

Details:
    (DrillDownGroupLevel = 0 and {?Group1Parameter} <> "*") or
    (DrillDownGroupLevel = 1 and {?Group2Parameter} <> "*") or
    (DrillDownGroupLevel = 2 and {?Group3Parameter} <> "*")

Save and Close and Test.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 13719681
Glad i could help

mlmcc
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 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