Although filtering is one of the key components of an effective report, it alone is not enough. Often, to properly see the key pieces of data, a report needs to be sorted. Crystal Reports is quite flexible when it comes to sorting, allowing any field type to be sorted, as well as multiple and ascending or descending sorts. Sorting is applied using the Sort Expert. Working with the Sort ExpertThe Sort Expert is launched from a button on the Experts toolbar, and also via the Record Sort Expert item on the Report menu. Figure 7.5 shows the Sort Expert. Figure 7.5. The Sort Expert.To apply sorting to the report, select a field from the list of available fields on the left side of the dialog area, and click the arrow (>) button to add that field to the sort fields list. Note that like filters, sorts can use fields both on the report and fields not otherwise used in the report.
To see this in action, let's work through an example:
The Sort Expert allows sorting on both alphabetic and numeric fields. Let's modify this report to sort on salary instead of last name:
Notice that some employees have the same salary level. If you wanted to perform a secondary sort within duplicates of the primary sort field, you can simply add another sort field. These sort fields can be arranged up and down using the buttons near the top right corner of the Sort Expert. |