Whether to automatically sort data to match specified groups.

Property of

Report

Description

For groups to work properly, data must be sorted to match the groups.

If a Report object’s autoSort property is true, then the sql property of any query that is accessed by a StreamSource object that has groups will be modified automatically to include an ORDER BY clause that sorts the rowset in the correct order.

For example, if you have two Group objects, the first grouping by the field State and the second by Zip, then even if the query’s sql property is set as:

select * from SALES

the rowset will actually be generated internally with the SQL statement:

select * from SALES order by STATE, ZIP

If autoSort is false, the rowset is not altered by the report engine. It assumes that the query is correct and contains the necessary fields in the right order. Therefore, if you use the indexName property to set the rowset order, you should set autoSort to false; otherwise it defeats the purpose of using indexName.

Note: The default for the autoSort property was changed to false in dBASE Plus version 2.50. Versions prior to this had autoSort defaulting to true.