Sorting data from a query

You define a sort in a query to extract data in a specific order.

Before you begin

A sort can be specified using the native sort or IBM® Rational® Publishing Engine sort. The native sort allows you to enter the sort in the format supported native to the data source. A native sort is interpreted by the data source, while a Rational Publishing Engine sort is processed by Rational Publishing Engine as it extracts data from the data source.
For more information on native sorts, consult the data source documentation for details on the appropriate syntax.
Instead, you can create a sort in Rational RequisitePro®:
  1. Create a table and enter data.
  2. Sort the data.
  3. Create a view and save the data to it.
  4. Export the view to use as a data source schema in Rational Publishing Engine. The Data Services application automatically detects the view.
  5. Add the data source schema to your Rational Publishing Engine template.
The Rational RequisitePro data that is generated in the Rational Publishing Engine output retains the sorting from the view, however, some nested data might not display as nested.

Procedure

  1. Select an element in the template content editor.
  2. In the Properties view, expand Data.
  3. In the Sort property, click the ellipsis. The Sort Editor window displays.
  4. Specify the sort conditions:
    • To use a native sort, click the Native tab and enter the sort expression in the Native window. Click OK.
    • To use the Rational Publishing Engine sort, double-click an item in the Script tab to add to the sort expression. Then select the sorting order from the list displayed against the items.
    Whenever possible, use a native sort. The native sort generates documents more quickly than a Rational Publishing Engine sort.
  5. Click OK.

Results

The selected sort order is added to the current element.
Note: Rational Publishing Engine cannot check if the native sort is correct. Review the sort in the data source to verify its accuracy.

Example

Rational DOORS® example of creating a Native sort in a templates:

To define a native sort for a Rational DOORS data source:
  1. Open a Rational DOORS Module and click Tools > Sort.
  2. In the Sort on field, select Object Text.
  3. In the Order field, select Descending.
  4. Click Add.
  5. Click OK to save. You now have the Rational DOORS Sort available in the Sort List.
To copy the Rational DOORS sort to Rational Publishing Engine:
  1. Select the template element that contains the query to be sorted.
  2. In the Properties view, expand Data.
  3. In the Sort property, click the ellipsis. The Sort Editor window displays.
  4. In the Native tab, enter Descending Object Text.
Note: Rational Publishing Engine cannot check if the native sort is correct. Review the sort in the data source to verify its accuracy.

What to do next

You can remove the sort expressions by clicking Remove option displayed against each item. To remove all items, click Remove All.

Feedback