Rank Types
- 5 minutes to read
Rank summary display types are designed to display ranks of summary values in their columns and rows. To employ rank display values, use RankBinding in Optimized mode.
The following rank types are available:
Rank in a Column: Largest to Smallest
Displays the summary value’s rank among other values in the same column, where the largest value in the column is ranked as 1, and corresponding higher ranks are assigned to all values that are less than the largest value.
Example
static void itemClickEventHandler(object sender, ItemClickEventArgs e) {
BarItem barItem = sender as BarItem;
object[] barItemInfo = (object[])barItem.Tag;
PivotGridField field = (PivotGridField)barItemInfo[0];
FieldSummaryDisplayType newValue = (FieldSummaryDisplayType)barItemInfo[2];
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Value");
switch(newValue){
// ...
case FieldSummaryDisplayType.RankInColumnLargestToSmallest:
field.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.ColumnValue,
RankType.Dense, FieldSortOrder.Descending);
break;
// ...
}
field.Tag = newValue;
(field.Parent as PivotGridControl).ReloadData();
}
Note
Set PivotGridField.SummaryDisplayType to FieldSummaryDisplayType.RankInColumnLargestToSmallest in Legacy and LegacyOptimized modes.
Rank in a Column: Smallest to Largest
Displays the summary value’s rank among other values in the same column, where the lowest value in the column is ranked as 1 and ranks increase depending on the other values.
Example
static void itemClickEventHandler(object sender, ItemClickEventArgs e) {
BarItem barItem = sender as BarItem;
object[] barItemInfo = (object[])barItem.Tag;
PivotGridField field = (PivotGridField)barItemInfo[0];
FieldSummaryDisplayType newValue = (FieldSummaryDisplayType)barItemInfo[2];
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Value");
switch(newValue){
// ...
case FieldSummaryDisplayType.RankInColumnSmallestToLargest:
field.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.ColumnValue,
RankType.Dense, FieldSortOrder.Ascending);
break;
// ...
}
field.Tag = newValue;
(field.Parent as PivotGridControl).ReloadData();
}
Note
Set PivotGridField.SummaryDisplayType to FieldSummaryDisplayType.RankInColumnSmallestToLargest in Legacy and LegacyOptimized modes.
Rank in a Row: Largest to Smallest
Displays the summary value’s rank among other values in the same row, where the largest value in the row is ranked as 1, and corresponding higher ranks are assigned to all values that are less than the largest value.
Example
static void itemClickEventHandler(object sender, ItemClickEventArgs e) {
BarItem barItem = sender as BarItem;
object[] barItemInfo = (object[])barItem.Tag;
PivotGridField field = (PivotGridField)barItemInfo[0];
FieldSummaryDisplayType newValue = (FieldSummaryDisplayType)barItemInfo[2];
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Value");
switch(newValue){
// ...
case FieldSummaryDisplayType.RankInRowLargestToSmallest:
field.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.RowValue,
RankType.Dense, FieldSortOrder.Descending);
break;
// ...
}
field.Tag = newValue;
(field.Parent as PivotGridControl).ReloadData();
}
Note
Set PivotGridField.SummaryDisplayType to FieldSummaryDisplayType.RankInRowLargestToSmallest in Legacy and LegacyOptimized modes.
Rank in a Row: Smallest to Largest
Displays the summary value’s rank among other values in the same row, where the lowest value in the row is ranked as 1, and corresponding higher ranks are assigned to all values that exceed the lowest value.
Example
static void itemClickEventHandler(object sender, ItemClickEventArgs e) {
BarItem barItem = sender as BarItem;
object[] barItemInfo = (object[])barItem.Tag;
PivotGridField field = (PivotGridField)barItemInfo[0];
FieldSummaryDisplayType newValue = (FieldSummaryDisplayType)barItemInfo[2];
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Value");
switch(newValue){
// ...
case FieldSummaryDisplayType.RankInRowSmallestToLargest:
field.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.ColumnValue,
RankType.Dense, FieldSortOrder.Ascending);
break;
// ...
}
field.Tag = newValue;
(field.Parent as PivotGridControl).ReloadData();
}
Note
Set PivotGridField.SummaryDisplayType to FieldSummaryDisplayType.RankInRowSmallestToLargest in Legacy and LegacyOptimized modes.