bindingInfo.setTopN(field, header, number)
Sets the number of row or column groups to preserve in the ranking. This is equivalent to setting the number ‘N’ of ranking groups for the ‘Rank’ property of the Crosstab Editor.

This function should always be used in conjunction with bindingInfo.setTopNSummaryCol(field, header, measure) and bindingInfo.setTopNReverse(field, header, Boolean).
Parameters
- field
-
String: Name of a column to rank
- header
-
StyleConstant.ROW_HEADERorStyleConstant.COLUMN_HEADER - number
-
Integer: Number of groups to select
Example
Crosstab1.query = 'Sales';
Crosstab1.bindingInfo.rowFields = ['Name'];
Crosstab1.bindingInfo.colFields = ['Region'];
Crosstab1.bindingInfo.measureFields = ['Total'];
Crosstab1.bindingInfo.setFormula('Total', StyleConstant.SUM_FORMULA);
Crosstab1.bindingInfo.showColumnTotal = true;
Crosstab1.bindingInfo.setTopN('Name',StyleConstant.ROW_HEADER,3);
Crosstab1.bindingInfo.setTopNSummaryCol('Name',StyleConstant.ROW_HEADER,'Sum(Total)');
Crosstab1.bindingInfo.setTopNReverse('Name',StyleConstant.ROW_HEADER,false);

|
Either syntax below can be used in component script:
For onInit/onRefresh scripts, and for component and property scripts on other components, the second (qualified) form is required. |