#### Setting the sort manner

After a group has been added, you need to specify in which manner groups at current group level will be sorted.

- Ascend
  Groups will be sorted in ascending order.
- Descend
  Groups will be sorted in descending order.
- No Sort
  Groups will be arranged in their original order.
- Special Group
  Selecting this item will bring out the User Defined Group dialog for you to define how to group your information. See the dialog.

  For example, if you place a field named Score for grouping which contains student scores that range from 0 to 100, and you want to group the students in 5 ranks, namely rank A: 90~100, B: 80~89, C: 70~79, D: 60~69, and E: 0~59. You can set the following with the User Defined Group dialog.

  Group Name | Operator | Operand
  --- | --- | ---
  A | between | Op1: 90, Op2: 100
  B | between | Op1: 80, Op2: 89
  C | between | Op1: 70, Op2: 79
  D | between | Op2: 60, Op2: 69
  E | <= | 59

  There will be five groups in the order from A to E. If you want to change the order of the groups, you can also do so via the User Defined Group dialog.

- Custom Sort
  Selecting this item will bring out the Custom Sort dialog for you to define how to sort the groups. You can specify some fields in the dialog, then the groups will be sorted by the values of the first record in each group on the related fields.

  The following example shows how to sort groups by a specific field.

  Suppose that you have created a table based on the query EmployeeInformation in the catalog file SampleReports.cat as follows: added the fields Hire Date, Name, Home Phone and Salary to be displayed in the table, set the field Employee Position as the group by field and Ascend as the sort order, then applied the Neutral style to the table.

  For the example, specify the sorting criteria as follows:

  1. Right-click the table and select Table Wizard from the shortcut menu.
  2. In the Group screen of the Table Wizard, select the group by field Employee Position in the group by box, then select Custom Sort from the Sort column.
  3. In the Custom Sort dialog, add the field Salary to the sort by box, set the sorting manner as Ascend, then click OK.
  4. Click Finish in the Table Wizard to apply the settings.
  5. View the table again and you will find that the groups are sorted based on their first record's Salary values.