Class PivotFieldImpl
Represents a field in a PivotTable report.
Inheritance
Namespace: Syncfusion.XlsIO.Implementation.PivotTables
Assembly: Syncfusion.XlsIO.UWP.dll
Syntax
public class PivotFieldImpl : Object, ICloneParent, IPivotField
Constructors
PivotFieldImpl(PivotCacheFieldImpl, PivotTableImpl)
Initializes new instance of the pivot field.
Declaration
public PivotFieldImpl(PivotCacheFieldImpl cacheField, PivotTableImpl table)
Parameters
Type | Name | Description |
---|---|---|
PivotCacheFieldImpl | cacheField | Cache field that corresponds to this field. |
PivotTableImpl | table |
Fields
m_iItemInvisibleCount
Specifies the number of items of field set as invisible.
Declaration
public int m_iItemInvisibleCount
Field Value
Type |
---|
System.Int32 |
m_table
Represents the parent pivot table.
Declaration
public PivotTableImpl m_table
Field Value
Type |
---|
PivotTableImpl |
Properties
Axis
Gets or sets the field axis.
Declaration
public PivotAxisTypes Axis { get; set; }
Property Value
Type |
---|
PivotAxisTypes |
Examples
Following code snippet illustrates how to add a axis to pivot field.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
IWorksheet worksheet = workbook.Worksheets[0];
// Create Pivot cache with the given data range
IPivotCache cache = workbook.PivotCaches.Add(worksheet["A1:H50"]);
//Create "PivotTable1" with the cache at the specified range
IPivotTable pivotTable = worksheet.PivotTables.Add("PivotTable1", worksheet["A1"], cache);
//Add Pivot table fields (Row and Column fields)
pivotTable.Fields[2].Axis = PivotAxisTypes.Row;
pivotTable.Fields[6].Axis = PivotAxisTypes.Row;
pivotTable.Fields[3].Axis = PivotAxisTypes.Column;
CacheField
Gets the parent cache field. Read-only.
Declaration
public PivotCacheFieldImpl CacheField { get; }
Property Value
Type |
---|
PivotCacheFieldImpl |
CanDragOff
Gets or sets a Boolean value indicating if user can remove field from view. Read/Write Boolean. The default value is True.
Declaration
public bool CanDragOff { get; set; }
Property Value
Type |
---|
System.Boolean |
CanDragToColumn
Gets or sets a Boolean value indicating if user can drag field to column area. Read/Write Boolean. The default value is True.
Declaration
public bool CanDragToColumn { get; set; }
Property Value
Type |
---|
System.Boolean |
CanDragToData
Gets or sets a Boolean value indicating if the specified field can be dragged to the data position. Read/Write Boolean. The default value is True.
Declaration
public bool CanDragToData { get; set; }
Property Value
Type |
---|
System.Boolean |
CanDragToPage
Gets or sets a Boolean value indicating if user can drag field to page area. Read/Write Boolean. The default value is True.
Declaration
public bool CanDragToPage { get; set; }
Property Value
Type |
---|
System.Boolean |
CanDragToRow
Gets or sets a Boolean value indicating if user can drag field to row area. Read/Write Boolean. The default value is True.
Declaration
public bool CanDragToRow { get; set; }
Property Value
Type |
---|
System.Boolean |
Caption
Gets or sets the unique name to be used as a caption for the field and field items.
Declaration
public string Caption { get; set; }
Property Value
Type |
---|
System.String |
Compact
Gets or sets a boolean value indicating whether the application will display fields compactly in the sheet on which this PivotTable resides.
Declaration
public bool Compact { get; set; }
Property Value
Type |
---|
System.Boolean |
EnableQuartersAndYears
Get or set a Boolean value indicating whether the Quarters and Years fields are applied to a date field or not.
Declaration
public bool EnableQuartersAndYears { get; set; }
Property Value
Type |
---|
System.Boolean |
FieldGroup
Gets the pivot field group in current pivot field.
Declaration
public IPivotFieldGroup FieldGroup { get; }
Property Value
Type |
---|
IPivotFieldGroup |
FilterValue
Gets or sets the Filter value of Page fields.
Declaration
public string FilterValue { get; set; }
Property Value
Type |
---|
System.String |
Formula
Gets or sets the formula for the calculated field.
Declaration
public string Formula { get; set; }
Property Value
Type |
---|
System.String |
IncludeNewItemsInFilter
Gets or sets a Boolean value indicating whether newly added pivot table items should be tracked when manual filtering is applied to pivot field. Read/Write Boolean.
Declaration
public bool IncludeNewItemsInFilter { get; set; }
Property Value
Type |
---|
System.Boolean |
IsAutoFiltersByRank
Gets or sets a Boolean value indicating whether AutoShow filter applied to this field is set to show the top ranked values.
Declaration
public bool IsAutoFiltersByRank { get; set; }
Property Value
Type |
---|
System.Boolean |
IsAutoShow
True if the number of top or bottom items for a row, page, or column field in the specified PivotTable report is enabled. False otherwise.
Declaration
public bool IsAutoShow { get; set; }
Property Value
Type |
---|
System.Boolean |
IsDataField
True if the pivot field is a data field. False otherwise.
Declaration
public bool IsDataField { get; set; }
Property Value
Type |
---|
System.Boolean |
IsDragToHide
True if the user can remove field from view. False otherwise.
Declaration
public bool IsDragToHide { get; set; }
Property Value
Type |
---|
System.Boolean |
IsFormulaField
Gets or sets a Boolean value indicating if this field is formula field. Read-only.
Declaration
public bool IsFormulaField { get; }
Property Value
Type |
---|
System.Boolean |
IsMeasureField
Gets or sets a Boolean value indicating whether field has a measure based filter.
Declaration
public bool IsMeasureField { get; set; }
Property Value
Type |
---|
System.Boolean |
IsMultiSelected
Gets or sets a Boolean value indicating whether the field has multiple items selected in the page field.
Declaration
public bool IsMultiSelected { get; set; }
Property Value
Type |
---|
System.Boolean |
IsShowAllItems
Gets or sets a Boolean value indicating whether to show all items for this field.
Declaration
public bool IsShowAllItems { get; set; }
Property Value
Type |
---|
System.Boolean |
Items
Gets Pivot field items which are the individual data entries in a field category. Read-only.
Declaration
public IPivotFieldItems Items { get; }
Property Value
Type |
---|
IPivotFieldItems |
ItemsPerPage
Gets or sets the number of items showed per page in the PivotTable.
Declaration
public int ItemsPerPage { get; set; }
Property Value
Type |
---|
System.Int32 |
Name
Gets or sets the name of the pivot field.
Declaration
public string Name { get; set; }
Property Value
Type |
---|
System.String |
NumberFormat
Gets or sets the number format for the pivot field.
Declaration
public string NumberFormat { get; set; }
Property Value
Type |
---|
System.String |
NumberFormatIndex
Gets or sets number format index for the pivot field.
Declaration
public int NumberFormatIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
PivotFilters
Gets the IPivotFilters collection for the pivot field. Read-only.
Declaration
public IPivotFilters PivotFilters { get; }
Property Value
Type |
---|
IPivotFilters |
Position
Gets or sets the position of the field (first,second,third and so on) among all the fields in its Axis (Row,Column,Page,Data).
Declaration
public int Position { get; set; }
Property Value
Type |
---|
System.Int32 |
PreservedAutoSort
Gets or sets the stream that preserves the sorting elements of the field.
Declaration
public Stream PreservedAutoSort { get; set; }
Property Value
Type |
---|
System.IO.Stream |
RepeatLabels
Gets or sets visibility of repeated item labels for the specified pivot field.
Declaration
public bool RepeatLabels { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowBlankRow
Gets or sets a Boolean value indicating if a blank row is inserted after the specified row field in a PivotTable report. Read/Write Boolean.
Declaration
public bool ShowBlankRow { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowDropDown
True if the flag for the specified PivotTable field or PivotTable item is set to "drilled" (expanded, or visible). False otherwise.
Declaration
public bool ShowDropDown { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowItemPropAsCaption
Gets or sets a Boolean value indicating whether to show the item property value in a PivotTable cell.
Declaration
public bool ShowItemPropAsCaption { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowNewItemsInFilter
Declaration
public bool ShowNewItemsInFilter { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowNewItemsOnRefresh
Gets or sets a Boolean value indicating whether newly added pivot table items during manual filtering to pivot field, should be shown after refresh operation.
Declaration
public bool ShowNewItemsOnRefresh { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowOutline
Gets or sets a Boolean value that indicates whether the items in this field should be shown in Outline form.
Declaration
public bool ShowOutline { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowPageBreak
True if a page break is inserted after each field. False otherwise.
Declaration
public bool ShowPageBreak { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowPropAsCaption
Gets or sets a Boolean value indicating whether to show the property as a caption.
Declaration
public bool ShowPropAsCaption { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowSubtotalAtTop
Gets or sets a boolean value indicating whether the subtotal is positioned at the top. The default value is True.
Declaration
public bool ShowSubtotalAtTop { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowToolTip
Gets or sets a Boolean value that indicates whether to show the item value in a tooltip on the appropriate PivotTable cells.
Declaration
public bool ShowToolTip { get; set; }
Property Value
Type |
---|
System.Boolean |
SortType
Gets or sets the type of sort that is applied to this field.
Declaration
public Nullable<PivotFieldSortType> SortType { get; set; }
Property Value
Type |
---|
System.Nullable<PivotFieldSortType> |
Subtotals
Gets or sets the subtotal function used for pivot field.
Declaration
public PivotSubtotalTypes Subtotals { get; set; }
Property Value
Type |
---|
PivotSubtotalTypes |
Methods
AddItemOption(Int32)
Adds the specified item to the pivot field.
Declaration
public void AddItemOption(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index at which the item is to be added. |
AddItemOption(Int32, PivotItemOptions)
Adds the specified item at the specified index to the pivot field.
Declaration
public void AddItemOption(int index, PivotItemOptions item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index at which the item is to be added. |
PivotItemOptions | item | Pivot field item to be added. |
AutoSort(PivotFieldSortType, Int32)
Declaration
public void AutoSort(PivotFieldSortType sortType, int lineNumber)
Parameters
Type | Name | Description |
---|---|---|
PivotFieldSortType | sortType | |
System.Int32 | lineNumber |
Clone(Object)
Creates a new object that is a copy of the current instance.
Declaration
public object Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for a copy of this instance. |
Returns
Type | Description |
---|---|
System.Object | A new object that is a copy of this instance. |
Parse(IList, Int32)
Parses specified data at the offset to extract pivot field.
Declaration
public int Parse(IList data, int iPos)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IList | data | Records collection with data. |
System.Int32 | iPos | Offset to the first pivot field record. |
Returns
Type | Description |
---|---|
System.Int32 | Offset to the record after field's records. |
Serialize(OffsetArrayList)
Saves pivot table into OffsetArrayList.
Declaration
public void Serialize(OffsetArrayList records)
Parameters
Type | Name | Description |
---|---|---|
OffsetArrayList | records | OffsetArrayList that will get all pivot table records. |
Sort(String[])
Declaration
public void Sort(string[] orderByArray)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | orderByArray |