com.smartxls

## Class BookPivotField

- java.lang.Object
- - com.smartxls.BookPivotField

-     public class BookPivotField
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `SortAscend`
    `static int` | `SortAuto`
    `static int` | `SortDescend`
    `static int` | `SortManual`
    `static int` | `SubTotalTypeAutomatic`
    `static int` | `SubTotalTypeCustom`
    `static int` | `SubTotalTypeNone`
    `static short` | `SummarizeCalcAverage`
    `static short` | `SummarizeCalcCount`
    `static short` | `SummarizeCalcCountNums`
    `static short` | `SummarizeCalcMax`
    `static short` | `SummarizeCalcMin`
    `static short` | `SummarizeCalcProduct`
    `static short` | `SummarizeCalcStdDev`
    `static short` | `SummarizeCalcStdDevp`
    `static short` | `SummarizeCalcSum`
    `static short` | `SummarizeCalcVar`
    `static short` | `SummarizeCalcVarp`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCalcItem(java.lang.String name, java.lang.String formula)` add a calculated item to the field list items
    `boolean` | `canAddToArea(BookPivotArea area)` Indicates if this field can be added to the specified area.
    `java.lang.String[]` | `getFieldItems()` return the name of the field items
    `java.lang.String` | `getName()` the name of the pivot field
    `java.lang.String` | `getNumberFormatting()` get the custom formatting string from the specified area in pivot table
    `int` | `getSortType()` return the sort type
    `int` | `getSubTotalType()` return the type of subtotal
    `int` | `getSummarizeFieldCalcType()` Indicates the summary function type
    `boolean` | `isFieldItemHidden(int index)` is the field specified index shown or hidden
    `boolean` | `isSummarizeField()` Indicates if this field is a summary field
    `void` | `setFieldItemHidden(int index, boolean isVisible)` set the field item hidden or shown
    `void` | `setLayout(boolean compact, boolean outline, boolean subtotalTop)` set the pivot field lay out setting
    `void` | `setNumberFormatting(java.lang.String customFormat)` set the custom formatting for area in pivot table
    `void` | `setShowDataAs(ShowDataAs type)` set the ShowDataAs value for the summary field
    `void` | `setShowDetail(boolean show)` set whether the details are hidden for this field
    `void` | `setSortType(int type)` set the sort type
    `void` | `setSubTotalType(int type)` set the type of subtotal
    `void` | `setSummarizeFieldCalcType(int type, java.lang.String name)` Set the current calculation type of the summary field

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SummarizeCalcSum

          public static final short SummarizeCalcSum

      See Also:
        Constant Field Values

    - #### SummarizeCalcCount

          public static final short SummarizeCalcCount

      See Also:
        Constant Field Values

    - #### SummarizeCalcAverage

          public static final short SummarizeCalcAverage

      See Also:
        Constant Field Values

    - #### SummarizeCalcMax

          public static final short SummarizeCalcMax

      See Also:
        Constant Field Values

    - #### SummarizeCalcMin

          public static final short SummarizeCalcMin

      See Also:
        Constant Field Values

    - #### SummarizeCalcProduct

          public static final short SummarizeCalcProduct

      See Also:
        Constant Field Values

    - #### SummarizeCalcCountNums

          public static final short SummarizeCalcCountNums

      See Also:
        Constant Field Values

    - #### SummarizeCalcStdDev

          public static final short SummarizeCalcStdDev

      See Also:
        Constant Field Values

    - #### SummarizeCalcStdDevp

          public static final short SummarizeCalcStdDevp

      See Also:
        Constant Field Values

    - #### SummarizeCalcVar

          public static final short SummarizeCalcVar

      See Also:
        Constant Field Values

    - #### SummarizeCalcVarp

          public static final short SummarizeCalcVarp

      See Also:
        Constant Field Values

    - #### SubTotalTypeNone

          public static final int SubTotalTypeNone

      See Also:
        Constant Field Values

    - #### SubTotalTypeAutomatic

          public static final int SubTotalTypeAutomatic

      See Also:
        Constant Field Values

    - #### SubTotalTypeCustom

          public static final int SubTotalTypeCustom

      See Also:
        Constant Field Values

    - #### SortAuto

          public static final int SortAuto

      See Also:
        Constant Field Values

    - #### SortAscend

          public static final int SortAscend

      See Also:
        Constant Field Values

    - #### SortDescend

          public static final int SortDescend

      See Also:
        Constant Field Values

    - #### SortManual

          public static final int SortManual

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      the name of the pivot field
      Returns:
        name

    - #### canAddToArea

          public boolean canAddToArea(BookPivotArea area)

      Indicates if this field can be added to the specified area.
      Parameters:
        `area` - The desired area for adding the field.
      Returns:
        if this field can be added

    - #### isSummarizeField

          public boolean isSummarizeField()

      Indicates if this field is a summary field
      Returns:
        true if field is a summary field

    - #### getSummarizeFieldCalcType

          public int getSummarizeFieldCalcType()

      Indicates the summary function type
      Returns:
        summary function type one of the following values: SummarizeCalcSum`SummarizeCalcSum`,SummarizeCalcCount,SummarizeCalcAverage,SummarizeCalcMax,SummarizeCalcMin SummarizeCalcProduct,SummarizeCalcCountNums,SummarizeCalcStdDev,SummarizeCalcStdDevp,SummarizeCalcVar, SummarizeCalcVarp

    - #### setSummarizeFieldCalcType

          public void setSummarizeFieldCalcType(int type,
                                                java.lang.String name)

      Set the current calculation type of the summary field
      Parameters:
        `type` - the calculation type to be used. one of the following values: SummarizeCalcSum`SummarizeCalcSum`,SummarizeCalcCount,SummarizeCalcAverage,SummarizeCalcMax,SummarizeCalcMin SummarizeCalcProduct,SummarizeCalcCountNums,SummarizeCalcStdDev,SummarizeCalcStdDevp,SummarizeCalcVar, SummarizeCalcVarp
        `name` - filed name

    - #### getSubTotalType

          public int getSubTotalType()

      return the type of subtotal
      Returns:
        SubtotalType value one of the following values: SubTotalTypeNone`SubTotalTypeNone`,SubTotalTypeAutomatic,SubTotalTypeCustom

    - #### setSubTotalType

          public void setSubTotalType(int type)
                               throws java.lang.Exception

      set the type of subtotal
      Parameters:
        `type` - SubtotalType value one of the following values: SubTotalTypeNone`SubTotalTypeNone`,SubTotalTypeAutomatic,SubTotalTypeCustom
      Throws:
        `java.lang.Exception` - exception

    - #### getSortType

          public int getSortType()

      return the sort type
      Returns:
        SortType value one of the following values: SortAuto`SortAuto`,SortAscend,SortDescend,SortManual

    - #### setSortType

          public void setSortType(int type)
                           throws java.lang.Exception

      set the sort type
      Parameters:
        `type` - sort type value one of the following values: SortAuto`SortAuto`,SortAscend,SortDescend,SortManual
      Throws:
        `java.lang.Exception` - exception

    - #### getNumberFormatting

          public java.lang.String getNumberFormatting()

      get the custom formatting string from the specified area in pivot table
      Returns:
        custom format string

    - #### setNumberFormatting

          public void setNumberFormatting(java.lang.String customFormat)

      set the custom formatting for area in pivot table
      Parameters:
        `customFormat` - custom format string

    - #### setShowDataAs

          public void setShowDataAs(ShowDataAs type)

      set the ShowDataAs value for the summary field
      Parameters:
        `type` - `com.smartxls.enums.ShowDataAs`

    - #### setLayout

          public void setLayout(boolean compact,
                                boolean outline,
                                boolean subtotalTop)

      set the pivot field lay out setting
      Parameters:
        `compact` - whether the application will display fields compactly in the sheet on which this PivotTable resides
        `outline` - whether the items in this field should be shown in Outline form
        `subtotalTop` - whether to display subtotals at the top of the group

    - #### setShowDetail

          public void setShowDetail(boolean show)

      set whether the details are hidden for this field
      Parameters:
        `show` - whether the details are shown for this field

    - #### setFieldItemHidden

          public void setFieldItemHidden(int index,
                                         boolean isVisible)
                                  throws java.lang.Exception

      set the field item hidden or shown
      Parameters:
        `index` - item index
        `isVisible` - visibility
      Throws:
        `java.lang.Exception` - exception when data field is applied or invalid parameter

    - #### isFieldItemHidden

          public boolean isFieldItemHidden(int index)

      is the field specified index shown or hidden
      Parameters:
        `index` - field index
      Returns:
        true if hidden

    - #### getFieldItems

          public java.lang.String[] getFieldItems()

      return the name of the field items
      Returns:
        names

    - #### addCalcItem

          public void addCalcItem(java.lang.String name,
                                  java.lang.String formula)
                           throws java.lang.Exception

      add a calculated item to the field list items
      Parameters:
        `name` - item name
        `formula` - item formula content
      Throws:
        `java.lang.Exception` - invalid formula