The data can be grouped and sorted. Grouped data is data that is sorted and separated into meaningful groups. For example, a customer list may be grouped by Postal Code or Region.
When data is grouped, the following sort and group direction options are available.
- Ascending order means smallest to largest (1 to 9, A to Z, False to True). The program sorts the records in ascending order and then begins a new group whenever the value changes.
- Descending order means largest to smallest (9 to 1, Z to A, True to False). The program sorts the records in descending order and then begins a new group whenever the value changes.
- Specified order is an order that you customize for your needs. The program places each record into the custom group that you specify, leaving the records in each group in original order or it sorts them in ascending or descending order, depending on your instructions.
When you sort, Crystal Reports for Enterprise asks you to define two things: the sort direction (ascending or descending), and the object you want the sort to be based on (sort object).
In single object sorting, all the records used in the report are sorted based on the values in a single object. Sorting an inventory report by stock number or sorting a customer list by customer number are examples of single object sorts.
In multiple object sorts, Crystal Reports first sorts the records based on the values in the first object selected. If two or more records have a matching object value in the first sort object, the matching records are sorted by the value in the second sort object. For example, if you choose to sort first by Country and then by Region, both in ascending order, the report would appear with countries listed in alphabetic order, and regions within each country listed in alphabetic order. Any other objects, such as the postal codes within each region, would remain unsorted.