Sort Sequence |
|
After selecting the Input Data Source, select Sort Sequence from the Report Designer Data menu to invoke the Sort Order window.
The default for PxPlus files and Views is to sort via primary key. For Query input, the default is the sort key specified in the Query definition.
(The ability to select a query definition as an input source was added in PxPlus 2020.)
The sort sequence can be defined in two ways: Pre-defined Sort and Custom Sort. Each of these sort types is explained below.
Pre-defined Sort |
Select Pre-defined Sort to sort the data based on one of the file's internal key structures (i.e. built-in key).
|
Custom Sort |
Create a Custom Sort sequence.
When defining a Custom Sort, you may specify two sorting sequences. The first is the Input sort, which specifies how the data is to be extracted from the data source. Input sorts are based on the data source's built-in keys. By default, data is read using the primary key; however, if Static Filters are being applied to the data, it improves performance if the filters can be mapped to one of the built-in keys. Example: The second sorting sequence is for the report itself; that is, how the data is to be sequenced on the report. A custom report sort sequence can be comprised of up to 16 table elements in ascending or descending order. Custom sort elements can also be defined as case insensitive to ensure that upper and lowercase letters are sorted together. |
The grouping of data to be used in the report is a major consideration when determining a sort sequence. For example, if the data is to be grouped by department, and then by each manager within the department, the sort sequence must be by department first, then by manager.
If you create groupings based on your sort selection but decide to change the sort later, the Report Designer will attempt to remap the groupings to the new sequence. You can choose to make the changes, clear the current groupings, or cancel the new sort order.