ABSTRACT (by Federico Levis ) Category: CEL
Cognos Extension Library (CEL) Feature: Dynamically Sort a RS List by Clicking Column Header.
Prerequisite: Cognos Extension Library (CEL) is installed and included in your Report
1. Features
Sort by clicking Table Header:
a) If The Report has only one page, it is very quick, the Table is ordered locally without NO Report query re-execution. This case is more frequent if you increase List Rowper Page (e.g 500).
b) If The Report has More Pages, Sort is implemented re-executing the Report Query
Both cases have the same Loook & feel for the User.
Columns are sorted by their type: e.g. Country and City by String, PaymentDate by Date , Amount by Number
The Report Header is automatically aligned, displaying current Sort Settings
Also a Prompt SortTable with Sort Parameter is provided by the Library, to be displayed in Prompt Section
2. Steps to add this Feature to Your Report
Following steps are general and valid for all cases; we will simply refer as example to the values of the Video in the Top of this Post:
Copy the 2 queries QrySortTable and QryCognosNumber from CEL
Insert with LayoutComponentReference a reference to CEL BlockTableSort and define an Hidden Parameters reportId identifying this Report: e.g. reportId = 101
If you want to see Current Sort parameters in the Report Header:
You have simply to insert in Page1 header a LayoutComponentReference to CEL blockHeaSortTable
Insert into cognos_sort CEL DB table the records describing The columns of the List of this Report (with ReportId=101):
Add a "Sort" Data Item to the List Query, associating the DB cognos_sort.SORT_ID to the relative Query Items of the List:
Set this "Sort" Data Item as Sort Item of the List
Enclose Your List (Table to be Sorted) in a span with id="tblMain":
That's all: CEL will automatically take care of everything!