Crystal Report not sorting the group field in ascending order as it is set up to do

Alicia Uhacz picture Alicia Uhacz · Aug 8, 2013 · Viewed 9.3k times · Source

I have a report with three groups:

  1. Project
  2. RFI
  3. Status

I am conditionally suppressing groups 2 and 3. In each suppress formula section respectively, it says

{?Sort}="RFI" (or "Status")

It does the suppression correctly. However, when it is sorted by Status, the status field is not in ascending order. Does anyone know hwy this would happen?

I can't choose a table in the Group Sort Order Formula either: I can't choose a table in the Group Sort Order Formula either:

Answer

Ryan picture Ryan · Aug 8, 2013

Suppressing report sections will have no bearing on how the records are sorted. A report will always have its records sorted from the outer-most group field to the inner-most group field. In your report, the records will first be sorted by "Project", then by "RFI", and finally by "Status" regardless of what you are or are not suppressing.

If you want to choose which field to sort the report by via a parameter, then you should create a formula field and sort by that instead. So something like: if {?Sort}="RFI" then {table.RFI} else {table.Status} but you'll need to get rid of your RFI and Status groups first.