Sort Order

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Sort Order

Previous pageReturn to chapter overviewNext page

 

The Sort Order dialog allows you to specify how data from a section's data source is sorted.  ReportPro allows you to sort your data on one or more fields in either ascending or descending order.

 

An ascending sort means the resulting sort will look like "A", "B", "C" or 1, 2, 3.  A descending sort will produce results like "C", "B", "A" and 3, 2, 1.  When ReportPro sorts data from DBF tables, the sort is case independent meaning that "c" and "C" will be sorted to the same location.  Whether or not data sorted by an SQL server is case dependent depends on how the server was configured.  Jasmine database sorts are always case dependent.

 

_bm50

 

To specify a sort order, highlight the field in the Available Fields list that you wish to sort by and click the _bm24 button.  This process will add the field to the Sorted By list.  You can remove a field from the Sorted By list by highlighting it and clicking the _bm26 button.  Alternately, you can add and remove fields from the Sorted By list by simply double clicking on the field.

 

Fields in the Sorted By list have an indicator next to them that identifies if the field will be sorted in ascending or descending order.  "(A)" indicates an ascending sort order, while "(D)" indicates descending.  To change the sort method, highlight the Sorted By field you wish to modify, and select the desired method from the Sort Method list located at the bottom of the dialog.

 

More than one field can be specified in the Sorted By list box.  Any subsequent field creates a sub-sort of the previously listed fields.

 

The Unique Order option forces ReportPro to include only unique values in the sort order.  For SQL data sources this causes the "Distinct" clause to appear in the SELECT statement.  For Jasmine databases, it causes the .unique() method to be invoked on the ODQL result set.

 

The Tables list box allows you to limit the fields displayed in the Available Fields list to those of a single table or query.  This feature is very useful when you are creating a report that uses more than one table.  To specify a table filter, click on the down arrow on the list box and choose the desired table.  If you wish to see the fields for all tables, select the <All Tables> entry.

 

In most cases the data source driver performs the sorting operation you specify.  If you are using an SQL or Jasmine database, the sorting information is sent to the server where the sort is performed.  For DBF files, ReportPro creates an index to satisfy the sort request.  ReportPro is capable however, of sorting information from dissimilar data sources.  This situation occurs when you specify fields from different sources in the sort order.  In this situation, ReportPro must retrieve the information from the data sources and store the information on a local hard drive.  Although this is an extremely power feature, it can require a large amount of disk space and processing time depending on how much information is being gathered.  For performance reasons, you should try to specify a sort order that can be performed by the server.