• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 895
  • Last Modified:

Conditional Sorting in Crystal XI

Hi,
I am creating a report with mulitple groupings.
The user wants the functionality to include if she selects 'N' for a parameter passed in then she not only wants to suppress the group headings but also wants to exclude this grouping as part of the record sorting order.

Eg. For example
DEFAULT GROUPING:
Organisation
Department
DocumentID

If she selects 'N' for the 'Sort by Department' parameter then she wants the records sorted by
Organisation
DocumentID only.

I have tried to use the Change Group Option - 'Use a Forumla as Group Sort Order' function and used the formula
if {?Param8} = 'N' then crOriginalOrder else crAscendingOrder
although this did not work.
0
fjhume79
Asked:
fjhume79
  • 2
1 Solution
 
mlmccCommented:
Try it this way for each group.

Group on formulas rather than the field

Group1_Organization
If ({OrgParam} = 'Y') then
    {OrganizationField}
Else
    'A'

Group2_Department
If ({DeptParam} = 'Y') then
    {DepartmentField}
Else
    'A'

Group3_DocumentID
If ({DocParam} = 'Y') then
    {DocumentField}
Else
    'A'

If any of the fields are not strings then use a default value for that field like 1

mlmcc
0
 
mlmccCommented:
You might also use suppression on the group header/footer sections

For example for the Orginzation field
({OrgParam} = 'N')

mlmcc
0
 
fjhume79Author Commented:
Thank you. Much appreciated
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now