The Sort page in the Reports Explorer lets you choose the order in which records appear in the report. For example, you may wish to have a report sorted by city and within city, chronologically by a certain date field. Note: this page may not be available for some reports.
The following options are available in this page:
- Use same sort next time report is run: if this option is turned on, any sort order specified is used as the default sort order the next time the report is selected. Of course, the sort order can be changed the next time, but this option is handy if you usually use the same sort order each time the report is run.
- Initial sort order: if this report is grouped on one or more fields, these fields are listed as an initial sort order; any fields you sort on in this step are used after the initial sort order. You cannot change the initial sort order without editing the report and changing the grouping.
- Available sort fields: a list containing the fields that appear in this report that have not already been selected for sorting.
- Selected sort fields: a list showing the fields the report data is sorted on. Fields in this list may be moved up and down to change the order in which the data is sorted; to do this, click the button in front of the desired field and drag the button up or down in the list.
- Add: selecting this button adds the selected field in the Available list to the Selected list. You can also add the field by double-clicking it in the Available list or selecting it and pressing Enter. The field is removed from the Available list.
- Remove: selecting this button removes the selected field from the Selected list. You can also remove the field by double-clicking it in the Selected list or selecting it and pressing Enter. The field is added to the Available list.
- Ascending: selecting this button sorts the selected field from lowest to highest.
- Descending: selecting this button sorts the selected field from highest to lowest.
Note that you can only sort on fields that appear in the report. If you want to sort on a field that doesn't appear in the report, add the field to the report and in the Properties dialog for that field, turn off the Display this field in the report setting. This tells Stonefield Query to not display that field but to still retrieve it from the database.
Note also that sorting on totaled fields in summary reports is given higher priority than grouped fields. This allows you to show, for example, sales by product with the biggest selling items first by using a descending sort on the sales amount field.