QuerySection object, ResultsSection object, TableSection object
Collection of sorts within a Query, Results, or Table section.
In the Query section, sort line objects must be columns on the Request line since only these can be placed on the Sort Line. In the Results and Table section, sort line objects must be columns in the Results set.
The SortItems (Collection) provides you with the ability to create Sort Line objects (column names), add them to the Sort Line, specify a sort order, and force an immediate sort (for Results and Table).
All collections have the “Item(NameOrIndex)” method. This is the default method for all collections that returns collection items at a particular index or using a specific name. Use brackets ([]) to represent calls to the Item (Method). For example, these statements are identical: myItem = Documents[1] myItem = Documents.Item(1) myItem = Documents["StartUp.bqy"] myItem = Documents.Item("StartUp.bqy") |
The SortItems property uses the BqSortOrder constant group, which consists of these values:·
The example shows how to select sort objects (columns) in Query sections:
ActiveDocument.Sections["Query"].Sort
This following example shows how to add, modify and remove all sort line object(s) (columns) in Query sections:
ActiveDocument.Sections["Query"].Sort.Add() //ActiveDocument.Sections["Query"].Sort.Add(Column_Name) ActiveDocument.Sections["Query"].Sort.Item() //ActiveDocument.Sections["Query"].Sort.Item(Value) ActiveDocument.Sections["Query"].Sort.RemoveAll()
This example shows how to count sort items in the Query section:
ActiveDocument.Sections["Query"].Sort.Count
This example shows how to remove a Product Id sort from the Sort line in the Query section:
ActiveDocument.Sections["Query"].SortItems["Product Id"].Remove()
This example shows how to use ascending sort order in Query sections:
ActiveDocument.Sections["Query"].Sort["1"].SortOrder = bqSortAscend;
This example shows how to select sort objects (columns) in Results sections:
ActiveDocument.Sections["Results"].Sort
Add(Request item as String), Item(Value as NameOrIndex), RemoveAll(), SortNow()