RpReport:SetSortOrder() Method
<< Click to Display Table of Contents >> RpReport:SetSortOrder() Method |
![]() ![]() ![]() |
Purpose
This method allows you to specify the sort order of any section in the report.
Syntax
<oReport>:SetSortOrder(cSort, lUnique, [nSection]) NIL
Arguments
cSort | The string specifying the new sort order. This string must be specified as follows: |
"Table1.Field1 ASC, Table2.Field1 DESC".
Note that ASC is optional and is the default.
lUnique | Optional parameter indicating whether the order should be unique (true) or include all values (false). |
The default is false.
nSection | Optional section number. The default is the first section after the optional title section. |
Description
The primary section sort order can be set at runtime using this method. This is useful for when you want to allow your users to change the sort order at runtime.
Example
// Set the report sort order
oReport:SetSortOrder("Customer.CustNo ASC, WKORDER.Date ASC")
Note: This method maps directly to the primary section of the report.