Class PivotEngine
This class encapsulates pivoting calculation support. To use it, first populate the PivotColumns and PivotRows collections to define the properties being pivoted. Then you populate the PivotCalculations collection to define the values you would like to see populated.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation.PivotAnalysis
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class PivotEngine : INotifyPropertyChanged
Constructors
PivotEngine()
Declaration
public PivotEngine()
Fields
columnIndexes
List that holds column indexes.
Declaration
public List<int> columnIndexes
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Int32> |
highWaterRowIndex
Value that indicates the maximum number of rows should be displayed.
Declaration
public int highWaterRowIndex
Field Value
| Type | Description |
|---|---|
| System.Int32 |
sortColIndexes
List that holds the sorted column indexes.
Declaration
public List<int> sortColIndexes
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Int32> |
Properties
AllowedFields
Gets a collection of FieldInfo objects that hold the field names that you want to make visible in the engine. The names can be either public property names of the underlying data objects or they can be expression field.
Declaration
public List<FieldInfo> AllowedFields { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<FieldInfo> |
Remarks
If your data contains fields that you do not want exposed to the pivoting process, then add the names of the properties you want to include to this list. All other fields will be excluded.
If you leave this collection empty, the default behavior will be to make all public properties available for use in the pivot table.
To add an expression field, set the FieldInfo.FieldType to FieldsType.Expression and set FieldInfo.Expression to be a string holding a well formed expression defining the value that should appear in this field.
ApplyFormattedSummary
Gets or sets the formatted total value for the sub-total/grand total cells.
Declaration
public bool ApplyFormattedSummary { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
CacheRawValues
Gets or sets whether underlying raw values are cached as the Pivot is being built. If these values are cached, then GetRawItemsFor method calls do not require traversing the underlying data to complete.
Declaration
public bool CacheRawValues { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ColumnCount
Gets the number of columns in the PivotTable.
Declaration
public int ColumnCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
CoveredRanges
Gets a list of CoveredCellRange objects that specify the cells that need to be covered.
Declaration
public List<CoveredCellRange> CoveredRanges { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<CoveredCellRange> |
DataSource
Gets or sets data source for this PivotTable. This object should be either an IEnumerable List or a DataTable.
Declaration
public object DataSource { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object |
DataSourceList
Used internally. Gets or sets an IEnumerable List that is used as the data source for the PivotTable. The default behavior is to initialize this list from DataSource.
Declaration
public virtual IEnumerable DataSourceList { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.IEnumerable |
EditCellsInfo
Gets or sets the edited cells information.
Declaration
public Dictionary<string, Array> EditCellsInfo { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, System.Array> |
EmptyPivot
If you apply a filter which filters out all items in the underlying data source, then this "EmptyPivot" property will be set true. The RowCount and ColumnCount will be set to one, and the Engine[0, 0] will hold the value.
Declaration
public bool EmptyPivot { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
EmptyPivotString
Gets or sets the string that appears when no items are present in a Pivot result.
Declaration
public string EmptyPivotString { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
EnableDataOptimization
Gets or sets a value to indicate whether the data should be loaded in an optimized way to render huge data with less time consumption.
Declaration
public bool EnableDataOptimization { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Setting this property indicates that the PivotEngine should populate the data based on combining the population logics used in both PivotEngine and IndexEngine. There is no need to set the properties "UseIndexedEngine" and "EnableOnDemandCalculations" is true when using the property "EnableDataOptimization". This feature will work significantly with less time consumption to populate and the render the values even using large pivots.
EnableLazyLoadOnDemandCalculations
When setting the EnableOnDemandCalculations property to true, it allows the UI to trigger the summary calculations during the application idle cycles.
Declaration
public bool EnableLazyLoadOnDemandCalculations { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This means that the summaries in the Pivot control may be fully populated when the user does something like sort/filter a PivotItem which avoids a delay. If EnableOnDemandCalculations is false, setting this property has no effect.
EnableOnDemandCalculations
Gets or sets whether the calculations are postponed until the value is requested through the Indexer on PivotEngine. The default value is false.
Declaration
public bool EnableOnDemandCalculations { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
The default calculation behavior is for all the value cells to be populated during the call to PivotEngine.Calculate. When EnableOnDemandCalculations is set true, then the calculations are postponed until there is an initial request for a calculated value. At that time, the calculation is completed and stored. Subsequent requests for a value return the stored value instead of redoing the calculations.
Setting the EnableOnDemandCalculations allows the initial display of a large pivot table as only the visible cells will need to be calculated. This speed up in initial display, does come at the cost of a slight degradation in first-time scrolling performance as the cells that are newly made visible through the scrolling require a calculation to be completed. This setting is not available when RowPivotsOnly is false.
EnableSubTotalHiding
Gets or sets whether PivotGrid control should hide the sub-totals in engine level when setting the property ShowSubTotals to false.
Declaration
public bool EnableSubTotalHiding { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
The default value is false.
Filters
Gets a list holding FilterExpression values that specify any filters that need to be applied to this PivotTable.
Declaration
public List<FilterExpression> Filters { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<FilterExpression> |
GetValue
Gets or sets a GetValueDelegate delegate that returns a property value for a given object.
Declaration
public GetValueDelegate GetValue { get; set; }
Property Value
| Type | Description |
|---|---|
| GetValueDelegate |
Remarks
If this member is null, the IndexEngine will use reflection to obtain property values from objects in the DataSource. NOTE: Usually a well written delegate can provide values more efficiently than using reflection. For performance improvements, you will want to provide a well written delegate for this property.
GrandString
Gets or sets the prefix string in the collection-wide totals that appear below and to the right of the PivotTable.
Declaration
public string GrandString { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
GridLayout
Gets or sets value to indicate whether sub-totals should be shown at the top or bottom.
Declaration
public GridLayout GridLayout { get; set; }
Property Value
| Type | Description |
|---|---|
| GridLayout |
Remarks
Default value is Normal.
HiddenPivotColumnGroups
Gets or sets the different hidden column groups.
Declaration
public Dictionary<int, List<HiddenGroup>> HiddenPivotColumnGroups { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.Int32, System.Collections.Generic.List<HiddenGroup>> |
HiddenPivotRowGroups
Gets or sets the different hidden row groups.
Declaration
public Dictionary<int, List<HiddenGroup>> HiddenPivotRowGroups { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.Int32, System.Collections.Generic.List<HiddenGroup>> |
HiddenRowIndexes
Gets or sets the values of the hidden rows.
Declaration
public HashSet<PivotCellInfo> HiddenRowIndexes { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.HashSet<PivotCellInfo> |
IgnoreWhitespace
Gets or sets a value indicating whether to ignore insignificant white space from the formatted text in rows and columns.
Declaration
public bool IgnoreWhitespace { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IndexEngine
Gets or sets the IndexEngine. IndexEngine provides a way to access the IndexEngine object from the PivotEngine class in-order to perform the on-demand process.
Declaration
public IndexEngine IndexEngine { get; set; }
Property Value
| Type | Description |
|---|---|
| IndexEngine |
IsDataDynamic
Gets or sets whether the DataSource is a collection of dynamic objects supported in the .NET Framework 4.0.
Declaration
public bool IsDataDynamic { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Item[Int32, Int32]
Gets the PivotCellInfo object associated with a particular cell in the PivotTable. The PivotCellInfo object contains value and formatted text properties information.
Declaration
public PivotCellInfo this[int rowIndex, int columnIndex1] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | Row index of the cell. |
| System.Int32 | columnIndex1 | Column index of the cell. |
Property Value
| Type | Description |
|---|---|
| PivotCellInfo | A PivotCellInfo object that contains information about the cell contents. |
ItemCollection
Gets or sets the collection of filter items.
Declaration
public FilterItemsCollection ItemCollection { get; set; }
Property Value
| Type | Description |
|---|---|
| FilterItemsCollection |
ItemProperties
Gets or sets a collection of property descriptors for the items in the DataSource. This property is initialized directly from the DataSource.
Declaration
public PropertyDescriptorCollection ItemProperties { get; set; }
Property Value
| Type | Description |
|---|---|
| System.ComponentModel.PropertyDescriptorCollection |
ItemType
Gets or sets the type of the objects in the DataSource. This property is initialized directly from the DataSource.
Declaration
public Type ItemType { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Type |
LoadInBackground
This property enables the Pivot control to perform loading operations asynchronously on a background thread.
Declaration
public bool LoadInBackground { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LockComputations
Gets or sets the boolean value indicating whether the computation need to happen. It is handled in suspend and resume computation method.
Declaration
public bool LockComputations { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
NotPopulated
Gets or sets value to check whether the values of the PivotTable are populated or not.
Declaration
public bool? NotPopulated { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |
PivotCalculations
Gets or sets a collection of PivotComputations.
Declaration
public List<PivotComputationInfo> PivotCalculations { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<PivotComputationInfo> |
PivotColumns
Gets or sets a collection of column based PivotItems.
Declaration
public List<PivotItem> PivotColumns { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<PivotItem> |
PivotRows
Gets or sets a collection of row based PivotItems.
Declaration
public List<PivotItem> PivotRows { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<PivotItem> |
PivotValues
Gets the underlying object collection represented in the PivotEngine.
Declaration
public PivotCellInfos PivotValues { get; }
Property Value
| Type | Description |
|---|---|
| PivotCellInfos |
PopulationStatus
Gets or sets value to check whether the PivotEngine is loading in the background.
Declaration
public double PopulationStatus { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
RowCount
Gets the number of rows in the PivotTable.
Declaration
public int RowCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
RowPivotsOnly
Gets or sets value indicating whether to Pivot only rows and calculations.
Declaration
public bool RowPivotsOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Turning this property "ON", enables the PivotGrid control to appear like a flat Grid in which rows and calculations will be displayed as value columns.
ShowCalculationsAsColumns
Gets or sets whether the calculations should appear as rows/columns in the PivotGrid. By default the calculations is displayed as columns.
Declaration
public bool ShowCalculationsAsColumns { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ShowEmptyCells
Gets or sets a value indicating whether to show an empty cell or not, when the value is null. By default, the value is true.
Declaration
public bool ShowEmptyCells { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ShowGrandTotals
Gets or sets value to show/hide grand totals.
Declaration
public bool ShowGrandTotals { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Default value is true.
ShowNullAsBlank
Gets or sets whether the Pivot control should display null value as blank instead of 0.
Declaration
public bool ShowNullAsBlank { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
The default value is false.
ShowSingleCalculationHeader
Gets or sets a value to indicate whether calculation header should be shown/hidden when there is a single calculation. The default value is false. This property does not affect the settings when "UseIndexedEngine" is set to true.
Declaration
public bool ShowSingleCalculationHeader { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ShowSubTotalsForChildren
Gets or sets whether PivotGrid control should show the summaries of child nodes when setting property ShowSubTotalsForChildren to true.
Declaration
public bool ShowSubTotalsForChildren { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
The default value is false.
SortDirection
Gets or sets the sort direction of Pivot values. The sort direction could be either ascending/descending.
Declaration
public ListSortDirection SortDirection { get; }
Property Value
| Type | Description |
|---|---|
| System.ComponentModel.ListSortDirection |
SummaryLibrary
Gets a dictionary of SummaryBase computations available in the PivotEngine.
Declaration
public Dictionary<string, SummaryBase> SummaryLibrary { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, SummaryBase> |
UseDescriptionInCalculationHeader
Gets or sets a value to indicate whether the description is to be displayed in the header cell when more than one calculation is being used. The default behavior is to use the "FieldName".
Declaration
public bool UseDescriptionInCalculationHeader { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
UseIndexedEngine
Gets or sets whether an optimized algorithm that relies on indexing the raw data used to compute the Pivot information.
Declaration
public bool UseIndexedEngine { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
UsePercentageFormat
Gets or sets whether the formatted text of the columns, which has percentage calculation type, must apply with given format or default percentage format #,##%
Declaration
public bool UsePercentageFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
VisibleRecords
Gets or sets the collection of objects which are currently used in the Grid.
Declaration
public List<object> VisibleRecords { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Object> |
Methods
AddAllowedField(FieldInfo)
Adds the field to "AllowedFields" property.
Declaration
public void AddAllowedField(FieldInfo fi)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo | fi | FieldInfo |
AddColumnPivot(PivotItem)
Adds a PivotItem to the PivotColumns collection.
Declaration
public void AddColumnPivot(PivotItem pivotItem)
Parameters
| Type | Name | Description |
|---|---|---|
| PivotItem | pivotItem | The item to be added. |
AddComparers(Type)
Adds a FilterExpression comparer for the specific PivotItem.
Declaration
public IComparer AddComparers(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | Property type of the PivotItem. |
Returns
| Type | Description |
|---|---|
| System.Collections.IComparer |
AddFilter(FilterExpression)
Adds a FilterExpression to the Pivot Schema of this Engine.
Declaration
public void AddFilter(FilterExpression item)
Parameters
| Type | Name | Description |
|---|---|---|
| FilterExpression | item | The filter expression. |
AddPivotCalculation(PivotComputationInfo)
Adds calculation to the PivotCalculations collection.
Declaration
public void AddPivotCalculation(PivotComputationInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| PivotComputationInfo | info | The calculation field. |
AddRowPivot(PivotItem)
Adds PivotItem to the PivotRows collection.
Declaration
public void AddRowPivot(PivotItem pivotItem)
Parameters
| Type | Name | Description |
|---|---|---|
| PivotItem | pivotItem | The item to be added. |
AdjustColumnIndexes(Int32, Int32)
This method is used internally within the Syncfusion library code to adjust column indexes.
Declaration
public void AdjustColumnIndexes(int from, int to)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | from | Old index position. |
| System.Int32 | to | New index position. |
AnyValueColumnsSorted()
Returns the sorted columns count.
Declaration
public bool AnyValueColumnsSorted()
Returns
| Type | Description |
|---|---|
| System.Boolean | Column count. |
CalculateFormula(Int32, Int32, Int32, PivotComputationInfo)
Calculated the cell value based on the formula given to the computation.
Declaration
public void CalculateFormula(int row1, int col1, int col, PivotComputationInfo compInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | row1 | The row index. |
| System.Int32 | col1 | The column index. |
| System.Int32 | col | The column index from pivot engine. |
| PivotComputationInfo | compInfo | The pivot computation information. |
CanFilterColumn(Int32)
Checks whether a column at the given index is filterable. This is used only when "RowPivotsOnly" is set to true.
Declaration
public bool CanFilterColumn(int columnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | columnIndex | The index of the column in the display. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if the column can be filtered; otherwise, false. |
CanSortColumn(Int32)
Checks whether a column at the given index is sortable. This is used only when "RowPivotsOnly" is set to true.
Declaration
public bool CanSortColumn(int columnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | columnIndex | The index of the column in the display. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if the column can be sorted, otherwise, false. |
ClearAllowedFields()
Clears the allowed fields in the Pivot control.
Declaration
public void ClearAllowedFields()
ClearFilters()
Clears all filter expressions from the Pivot Schema for the engine.
Declaration
public void ClearFilters()
ClearSortAt(Int32)
Clears the sort at the specified index.
Declaration
public void ClearSortAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The specified index. |
ClearSorts()
Clears all the sorted order in Grid.
Declaration
public void ClearSorts()
CoverColumnHeaders()
Generates the covered ranges of each column header cell.
Declaration
public void CoverColumnHeaders()
CoverGrandTotalRanges()
Generates the covered ranges of grand total cell.
Declaration
public void CoverGrandTotalRanges()
CoverRowHeaders()
Generates the covered ranges of each row header cell.
Declaration
public void CoverRowHeaders()
Dispose()
Method to dispose the PivotEngine resources in order to release the unmanaged memory.
Declaration
public void Dispose()
DoLazyCalculation()
When EnableOnDemandCalculations is true, this method will compute all summary calculation for the first row that has not been calculated yet.
Declaration
public bool DoLazyCalculation()
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if all the rows have their summary calculation completed; otherwise, false. |
EnsureCalculationsLoaded()
When "EnableOnDemandCalculations" is true, calling this method will ensure that all the summary calculations are fully computed. This is used internally.
Declaration
public void EnsureCalculationsLoaded()
FindFilterByName(String)
Finds a FilterExpression in Filters by its name.
Declaration
public FilterExpression FindFilterByName(string filterName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filterName | The name of the desired filter expression. |
Returns
| Type | Description |
|---|---|
| FilterExpression | The filter expression. |
GetFieldNameAtIndex(Int32)
Returns the field name at a given column even if the column has been moved from its original position. This is used only when "RowPivotsOnly" is set to true.
Declaration
public string GetFieldNameAtIndex(int columnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | columnIndex | The index of the column. |
Returns
| Type | Description |
|---|---|
| System.String | The field name at the specified index. |
GetHiddenRowKeyValueColumnIndex()
Gets the hidden rows key values.
Declaration
public int GetHiddenRowKeyValueColumnIndex()
Returns
| Type | Description |
|---|---|
| System.Int32 | Count of the hidden PivotRows. |
GetPivotEngineValueFor(Int32, Int32, Boolean)
Gets the PivotCellInfo object associated with a particular cell in the PivotTable. The PivotCellInfo object contains value and formatted text properties information.
Declaration
public PivotCellInfo GetPivotEngineValueFor(int rowIndex, int columnIndex1, bool shouldCalculateTotal)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | Row index of the cell. |
| System.Int32 | columnIndex1 | Column index of the cell. |
| System.Boolean | shouldCalculateTotal | if set to |
Returns
| Type | Description |
|---|---|
| PivotCellInfo | A PivotCellInfo object that contains information about the cell contents. |
GetRawItemsFor(Int32, Int32)
Returns the list of raw values.
Declaration
public List<object> GetRawItemsFor(int row, int col)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | row | The row index. |
| System.Int32 | col | the column index. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Object> | The raw items. |
GetRawItemsForEach(Int32, Int32)
Returns the collection of raw items for specified rows and columns in the Grid.
Declaration
public List<object> GetRawItemsForEach(int row, int col)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | row | The row index. |
| System.Int32 | col | The column index. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Object> | Collection of raw items. |
GetRowColumnPivotValuesAt(Int32, Int32, out String)
Returns the row and column PivotValues at the specified cell index.
Declaration
public List<IComparable> GetRowColumnPivotValuesAt(int row, int column, out string calcFieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | row | The row index of Pivot values. |
| System.Int32 | column | The column index of Pivot values. |
| System.String | calcFieldName | Name of the PivotField at the specified row and column index. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.IComparable> | List of values at the specified row and column index. |
GetSortDirection(Int32)
Gets the sort direction of a particular column, even if the column has been moved from its initial position. This is used only when "RowPivotsOnly" is set to true.
Declaration
public ListSortDirection GetSortDirection(int col)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | col |
Returns
| Type | Description |
|---|---|
| System.ComponentModel.ListSortDirection |
GetUnindexedPivotCellInfo(Int32, Int32)
Gets the un-indexed "PivotCellInfo".
Declaration
public PivotCellInfo GetUnindexedPivotCellInfo(int row, int col)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | row | Row index. |
| System.Int32 | col | Column index. |
Returns
| Type | Description |
|---|---|
| PivotCellInfo | PivotCellInfo |
GetVisibleRecords(List<FilterExpression>)
Returns the collection of objects which are currently used in the Grid.
Declaration
public List<object> GetVisibleRecords(List<FilterExpression> Filters)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.List<FilterExpression> | Filters | List of filter items collection. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Object> | Collection of objects currently used. |
InsertColumnPivot(Int32, PivotItem)
Inserts a PivotItem to the PivotColumns collection at a specified index.
Declaration
public void InsertColumnPivot(int index, PivotItem pivotItem)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The index to insert PivotItem into PivotColumns. |
| PivotItem | pivotItem | The item to be added. |
InsertFilter(Int32, FilterExpression)
Inserts a FilterExpression to the Pivot Schema for this Engine at a specified index.
Declaration
public void InsertFilter(int index, FilterExpression exp)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The index position. |
| FilterExpression | exp | The filter expression. |
InsertPivotCalculation(Int32, PivotComputationInfo)
Inserts calculation at a specified index.
Declaration
public void InsertPivotCalculation(int index, PivotComputationInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | Index to insert the calculation field. |
| PivotComputationInfo | info | The calculation field. |
InsertRowPivot(Int32, PivotItem)
Inserts a PivotItem to the PivotRows collection at a specified index.
Declaration
public void InsertRowPivot(int index, PivotItem pivotItem)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The index to insert PivotItem into PivotRows. |
| PivotItem | pivotItem | The PivotItem. |
IsColumnSorted(Int32)
Checks whether a column at the given index, in the display, is sorted or not.
Declaration
public bool IsColumnSorted(int columnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | columnIndex | The index of the column in the display. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if sorted; otherwise, false. |
IsRowSummary(Int32)
Checks whether the row at the specified index is summary row or not.
Declaration
public bool IsRowSummary(int rowIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | Index of the row. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if it's summary row; otherwise, false. |
IsSummaryColumn(Int32)
Checks whether the column is summary column or not.
Declaration
public bool IsSummaryColumn(int colIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | colIndex | Index of the column. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if it's summary column; otherwise, false. |
IsSummaryColumn(Int32, ref Int32)
Checks whether the column is summary column or not.
Declaration
public bool IsSummaryColumn(int colIndex, ref int k)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | colIndex | Index of the column. |
| System.Int32 | k | The argument to be passed by reference. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if it's summary column; otherwise, false. |
IsSummaryColumnWhileOnDemand(Int32, ref Int32)
Checks whether the column is summary column or not, when on-demand operation is performed.
Declaration
public bool IsSummaryColumnWhileOnDemand(int colIndex, ref int k)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | colIndex | Index of the column. |
| System.Int32 | k | The argument to be passed by reference. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if it's summary column; otherwise, false. |
IsSummaryColumnWhileTopSummary(Int32)
Checks whether the column is summary column or not, when GridLayout is TopSummary.
Declaration
public bool IsSummaryColumnWhileTopSummary(int colIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | colIndex | Index of the column. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if it's summary column; otherwise, false. |
IsSummaryRow(Int32, ref Int32)
Checks whether the row is summary row or not.
Declaration
public bool IsSummaryRow(int rowIndex, ref int k)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | Index of the row. |
| System.Int32 | k | The argument to be passed by reference. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if it's summary row; otherwise, false. |
IsSummaryRowWhileOnDemand(Int32, ref Int32)
Checks whether the row is summary row or not, when on-demand operation is performed.
Declaration
public bool IsSummaryRowWhileOnDemand(int rowIndex, ref int k)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | Index of the row. |
| System.Int32 | k | The argument to be passed by reference. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if it's summary row; otherwise, false. |
IsSummaryRowWhileTopSummary(Int32)
Checks whether the row is summary row or not, when GridLayout is TopSummary.
Declaration
public bool IsSummaryRowWhileTopSummary(int rowIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | Index of the row. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if it's summary row; otherwise, false. |
OnPivotSchemaChanged(PivotSchemaChangedArgs)
Raises the PivotSchemaChanged event.
Declaration
protected virtual void OnPivotSchemaChanged(PivotSchemaChangedArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| PivotSchemaChangedArgs | e | The event argument. |
Populate()
Using this method we can populate the values of the current PivotTable.
Declaration
public void Populate()
Remarks
Once you have populated the PivotColumns, PivotRows and PivotCalculations collections, you call this method to actually populate this engine with the PivotCalculations. After this call, you can then access information on the contents of any cell by indexing the engine object. The indexers are zero based.
PopulateDefaultPropertyFields()
Contains the default properties for the items in the DataSource.
Declaration
public void PopulateDefaultPropertyFields()
PopulateValueCells()
Populates the value cells.
Declaration
public void PopulateValueCells()
RaisePivotSchemaChangedEvent(PivotSchemaChangedArgs)
Raises the PivotSchemaChanged event.
Declaration
public void RaisePivotSchemaChangedEvent(PivotSchemaChangedArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| PivotSchemaChangedArgs | e | The event argument. |
ReArrangePivotValuesForColumn()
Re-arrange the PivotValues for column when grid layout is TopSummary.
Declaration
public void ReArrangePivotValuesForColumn()
ReArrangePivotValuesForRows()
Re-arrange the PivotValues for row when GridLayout is TopSummary.
Declaration
public void ReArrangePivotValuesForRows()
RefreshItemProperties()
Used to fill/re-fill the ItemProperties with newly added/updated fields.
Declaration
public void RefreshItemProperties()
RemoveAllowedField(FieldInfo)
Removes the allowed field from Grid.
Declaration
public void RemoveAllowedField(FieldInfo fi)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo | fi | The field to remove. |
RemoveColumnPivot(PivotItem)
Removes a PivotItem from the PivotColumns collection.
Declaration
public void RemoveColumnPivot(PivotItem pivotItem)
Parameters
| Type | Name | Description |
|---|---|---|
| PivotItem | pivotItem | The item to be removed. |
RemoveFilter(FilterExpression)
Removes a FilterExpression from the Pivot Schema for the engine.
Declaration
public void RemoveFilter(FilterExpression exp)
Parameters
| Type | Name | Description |
|---|---|---|
| FilterExpression | exp | The filter expression. |
RemovePivotCalculation(PivotComputationInfo)
Removes calculation from the PivotCalculations collection.
Declaration
public void RemovePivotCalculation(PivotComputationInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| PivotComputationInfo | info | The calculation field. |
RemoveRowPivot(PivotItem)
Removes a PivotItem from the PivotRows collection.
Declaration
public void RemoveRowPivot(PivotItem pivotItem)
Parameters
| Type | Name | Description |
|---|---|---|
| PivotItem | pivotItem | The item to be removed. |
Reset()
Resets the PivotTable and its collections.
Declaration
public void Reset()
ResolveColumnIndex(Int32)
Returns the original position of the column in the PivotCalculations collection. This is only used when "RowPivotsOnly" is set to true.
Declaration
public int ResolveColumnIndex(int columnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | columnIndex | The current position of the column in the display. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Returns the original position of the column as determined by its position in the PivotCalculations collection. |
ResumeComputations()
Resumes calculations after a call to suspend computations without re-setting the PivotTable.
Declaration
public void ResumeComputations()
ResumeComputations(Boolean)
Resumes calculations after a call to suspend computations with the option of re-setting the PivotTable.
Declaration
public void ResumeComputations(bool resetPivotCollections)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | resetPivotCollections | Returns true if the PivotTable should be recomputed; otherwise, false. |
ResumeComputations(Boolean, Boolean)
Resumes calculations after a call to "SuspendComputations" method with an option of re-setting the PivotTable.
Declaration
public void ResumeComputations(bool resetPivotCollections, bool shouldRefresh)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | resetPivotCollections | Returns true if the PivotTable should be recomputed; otherwise, false. |
| System.Boolean | shouldRefresh | Returns true if the Pivot control should be refreshed; otherwise, false. |
SortByCalculation(Int32)
Sort different values by calculation based on column index.
Declaration
public void SortByCalculation(int colIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | colIndex | The column index. |
SortByCalculation(Int32, Boolean)
Sort different values by calculation based on column index and multi-column sorting.
Declaration
public void SortByCalculation(int colIndex, bool isMultiColumn)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | colIndex | The column index. |
| System.Boolean | isMultiColumn | Returns true if multi-column sorting operation is done; otherwise, false. |
SortByCalculation(Int32, Boolean, ListSortDirection)
Sort different values by calculation based on column index, multi-column sorting and sort direction.
Declaration
public void SortByCalculation(int colIndex, bool isMultiColumn, ListSortDirection dir)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | colIndex | The column index. |
| System.Boolean | isMultiColumn | Returns true if multi-column sorting operation is done; otherwise, false. |
| System.ComponentModel.ListSortDirection | dir | Specifies the sort direction. |
SortColumnHeader(Int32)
Performs sorting operation in column header.
Declaration
public void SortColumnHeader(int colHeaderIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | colHeaderIndex | The index of column header. |
SuspendComputations()
Suspends calculations as PivotItems are added or removed from either RowPivots or ColumnPivots collections or when PivotCalculations are added or removed from the PivotCalculations collection.
Declaration
public void SuspendComputations()
Remarks
By default, calculations are always suspended. Once you have populated all the appropriate collections to define your PivotTable, you can call Populate() method to tell the engine to generate the PivotTable contents that you can access by indexing the engine.
UpdateAllSummariesRespectingHiddenRowIndexes()
This method will re-compute all the summaries ignoring certain summary row whose index is in "HiddenRowIndexes".
Declaration
public void UpdateAllSummariesRespectingHiddenRowIndexes()
UpdateCalculatedValue(Int32, Int32, Object, String)
Updates the calculated value based on the "CalculationType" of the computation object.
Declaration
public string UpdateCalculatedValue(int row, int col, object v, string fieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | row | The row index. |
| System.Int32 | col | The column index. |
| System.Object | v | The new value. |
| System.String | fieldName | Name of the field. |
Returns
| Type | Description |
|---|---|
| System.String | The formatted text. |
Events
PivotSchemaChanged
Event raised whenever the Pivot Schema of the Engine is changed.
Declaration
public event PivotSchemaChangedEventHandler PivotSchemaChanged
Event Type
| Type | Description |
|---|---|
| PivotSchemaChangedEventHandler |
PropertyChanged
Event triggered when the property of the cell is changed.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
| Type | Description |
|---|---|
| System.ComponentModel.PropertyChangedEventHandler |