Sorting Records

Objectives

After completing this lesson, you will be able to:

  • Sort records in a report

Record Sorting Methods

Learn how to sort, group, and summarize data.

Sorting Records

Once you have selected the records to print and positioned them on your report, you will likely want to sort them in a meaningful sequence. For example, you may want to sort them in alphabetical order or from highest to lowest sales. If you do not specify a sort order, Crystal Reports displays the records in their natural order, that is, the order in which they appear in your database.

Each field in the Sort Fields list can be assigned a sort direction in ascending or descending order independently. For example, you could sort your list by Region in alphabetical order, then by company in descending order of Last Year Sales.

Sort Control

A sort control allows the users to choose a sort direction without refreshing information from the database.

Users can sort the fields by clicking the sort arrows that appear beside the text object. The report promotes the selected field temporarily to the top of the sort order. When a second Sort Control is used, the first is returned to its original position in the sort order and the second is promoted to the top sort.

Note

To enable a Sort Control on a field, that field must be included in the Sort Fields list first.

Removing a Sort Control

To remove a sort control, choose Not Interactive.

The Sort Control is removed from the report.

Play the following video to learn how to implement interactive sort controls on a report.

Sort Controls Considerations

Benefits of Sort Controls

A Sort Control is useful for the following reasons:

  • It allows users to sort report data for further analysis without leaving the canvas of the report.

  • It eliminates processing demand on the database.

  • It reduces the time users spend waiting for data to be sorted.

  • It allows users to sort fields in the report even if they do not have a connection or rights to access the database at the time of viewing.

Sort Control Considerations

When planning to include a Sort Control in your report, it is important to consider the following points:

  • Sort controls apply across an entire record set; you cannot sort only one group.

  • Sort controls cannot be used in sub-reports.

  • Sort controls cannot be created within a cross-tab or an OLAP grid.

  • The use of sort controls causes any open drill-down tabs to close (a warning prompt alerts users).

Log in to track your progress & complete quizzes