• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 861
  • 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

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.

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