Creating a sorting definition

In some cases, there isn’t an appropriate key available to sort the report data the way you would like. In this situation, you must create a sorting definition. A sorting definition defines how you want to sort the report data. It is based on fields in the tables associated with the report. Using a sorting definition is a less-efficient method for sorting the report, because the Report Writer must read through each table used by the report to find the appropriate records to use. For optimal performance, you should use a sorting definition only when necessary.

To create a sorting definition, click the Sort button in the Report Definition window to open the Sorting Definition window. Use this window to define a sorting order that includes fields from any of the tables associated with the report.

From the Report Table drop-down list, select the table containing the field you wish to use to specify the sorting order. The name of each field in the selected table will appear in the Table Fields list. Select the desired field, and click Insert. The field name will be added to the Sort By list. Subsequently-added fields will be added to the top of the Sort By list, unless an item in the list is selected. If an item is selected, newly-added fields will be added below the selected item.

The sorting order will be based on the fields listed in the Sort By list. The data will be sorted based on the first field, then, if a secondary sorting order is needed, the second field, and so on. Be sure to include all fields necessary to fully define the desired order.

For each field selected, you can specify whether you want the data to be sorted in ascending or descending order (ascending is the default order) and whether to ignore the case of any string fields used as sorting criteria. If you ignore case, the strings will be sorted in strict alphabetical order. If you don’t ignore case and you are sorting in ascending order, all strings beginning with lowercase letters will appear in alphabetical order, followed by all strings beginning with uppercase letters, also in alphabetical order. In descending order, all of the uppercase strings will appear before the lowercase strings.

To select the Descending and/or Ignore Case options for a given field, select the desired field in the Sort By list and check the appropriate sorting options. Once you have specified all the sorting options, click OK to close the Sorting Definition window.

If none of the fields used to define the sorting order are from a secondary table, the report information drawn from that table will be sorted according to the key used to define that secondary table’s relationship with the report’s main table.

Once you have created a sorting definition for a report, it will override the sort order specified by the key selected for the report’s main table. To use the main table’s key as the sorting method, you must remove all of the items from the Sort By list in the Sorting Definition window.

Documentation Feedback