Rank Types
- 4 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
void SetSelectedSummaryDisplayType() {
if(SummaryDisplayTypeDataField == null)
return;
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding(SourceDataFieldName);
switch(ddlSummaryDisplayType.SelectedItem.Text) {
// ...
case "RankInColumnLargestToSmallest":
SummaryDisplayTypeDataField.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.ColumnValue,
RankType.Dense, PivotSortOrder.Descending);
SummaryDisplayTypeDataField.CellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
SummaryDisplayTypeDataField.CellFormat.FormatString = "n0";
break;
// ...
}
SummaryDisplayTypeDataField.Caption = string.Format("{0}", ddlSummaryDisplayType.SelectedItem.Text);
}
Note
Set PivotGridFieldBase.SummaryDisplayType to 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
void SetSelectedSummaryDisplayType() {
if(SummaryDisplayTypeDataField == null)
return;
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding(SourceDataFieldName);
switch(ddlSummaryDisplayType.SelectedItem.Text) {
// ...
case "RankInColumnSmallestToLargest":
SummaryDisplayTypeDataField.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.ColumnValue,
RankType.Dense, PivotSortOrder.Ascending);
SummaryDisplayTypeDataField.CellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
SummaryDisplayTypeDataField.CellFormat.FormatString = "n0";
break;
// ...
}
SummaryDisplayTypeDataField.Caption = string.Format("{0}", ddlSummaryDisplayType.SelectedItem.Text);
}
Note
Set PivotGridFieldBase.SummaryDisplayType to 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
void SetSelectedSummaryDisplayType() {
if(SummaryDisplayTypeDataField == null)
return;
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding(SourceDataFieldName);
switch(ddlSummaryDisplayType.SelectedItem.Text) {
// ...
case "RankInRowLargestToSmallest":
SummaryDisplayTypeDataField.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.RowValue,
RankType.Dense, PivotSortOrder.Descending);
SummaryDisplayTypeDataField.CellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
SummaryDisplayTypeDataField.CellFormat.FormatString = "n0";
break;
// ...
}
SummaryDisplayTypeDataField.Caption = string.Format("{0}", ddlSummaryDisplayType.SelectedItem.Text);
}
Note
Set PivotGridFieldBase.SummaryDisplayType to 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
void SetSelectedSummaryDisplayType() {
if(SummaryDisplayTypeDataField == null)
return;
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding(SourceDataFieldName);
switch(ddlSummaryDisplayType.SelectedItem.Text) {
// ...
case "RankInRowSmallestToLargest":
SummaryDisplayTypeDataField.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.ColumnValue,
RankType.Dense, PivotSortOrder.Ascending);
SummaryDisplayTypeDataField.CellFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
SummaryDisplayTypeDataField.CellFormat.FormatString = "n0";
break;
}
SummaryDisplayTypeDataField.Caption = string.Format("{0}", ddlSummaryDisplayType.SelectedItem.Text);
}
Note
Set PivotGridFieldBase.SummaryDisplayType to RankInRowSmallestToLargest in Legacy and LegacyOptimized modes.