GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PivotFieldCollection Class

    Namespace:
    GemBox.Spreadsheet.PivotTables
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a collection of PivotFields.

    • C#
    • VB.NET
    public sealed class PivotFieldCollection : PivotFieldBaseCollection, IEnumerable<PivotField>, IEnumerable
    Public NotInheritable Class PivotFieldCollection
        Inherits PivotFieldBaseCollection
        Implements IEnumerable(Of PivotField), IEnumerable
    Inheritance:
    System.Object
    PivotFieldBaseCollection
    PivotFieldCollection
    Implements
    System.Collections.Generic.IEnumerable<PivotField>
    System.Collections.IEnumerable

    Methods

    AddCalculated(String, String)

    Adds a calculated PivotField to the end of the collection of PivotTable fields.

    • C#
    • VB.NET
    public PivotField AddCalculated(string fieldName, string formula)
    Public Function AddCalculated(fieldName As String, formula As String) As PivotField
    Parameters
    fieldName
    System.String

    The name of the calculated PivotField.

    formula
    System.String

    The formula of the calculated PivotField.

    Returns
    PivotField

    Newly created PivotField.

    Exceptions
    System.InvalidOperationException

    PivotTable created from non-worksheet data source cannot be modified.

    System.ArgumentException

    fieldName can't be null or System.String.Empty.

    System.ArgumentException

    formula can't be null or System.String.Empty.

    System.ArgumentException

    fieldName must be unique.

    RemoveCalculated(String)

    Removes the calculated PivotField from the collection of PivotTable fields.

    • C#
    • VB.NET
    public void RemoveCalculated(string fieldName)
    Public Sub RemoveCalculated(fieldName As String)
    Parameters
    fieldName
    System.String

    The name of the calculated PivotField.

    Exceptions
    System.InvalidOperationException

    PivotTable created from non-worksheet data source cannot be modified.

    System.ArgumentException

    fieldName can't be null or System.String.Empty.

    System.ArgumentException

    Field with specified name doesn't exist.

    System.ArgumentException

    Field with specified name is not a calculated field.

    Inherited Properties

    Count

    Gets the number of PivotFields contained in the collection.

    (Inherited from PivotFieldBaseCollection)

    Item[System.Int32]

    Gets the PivotField at the specified index.

    (Inherited from PivotFieldBaseCollection)

    Item[System.String]

    Gets the PivotField with the specified name.

    (Inherited from PivotFieldBaseCollection)

    Inherited Methods

    Contains(PivotField)

    Determines whether the PivotField is contained in the collection.

    (Inherited from PivotFieldBaseCollection)

    GetEnumerator()

    Returns an enumerator for the collection.

    (Inherited from PivotFieldBaseCollection)

    IndexOf(PivotField)

    Searches for the specified PivotField and returns the zero-based index of the first occurrence within the entire collection.

    (Inherited from PivotFieldBaseCollection)

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.