com.smartxls

## Class BookPivotRange

- java.lang.Object
- - com.smartxls.BookPivotRange

-     public class BookPivotRange
      extends java.lang.Object

  represent the pivot range object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static short` | `areaAll`
    `static short` | `areaBlankColumnHeader`
    `static short` | `areaData`
    `static short` | `areaHeaders`
    `static short` | `areaTopLeft`
    `static short` | `column`
    `static short` | `data`
    `static short` | `page`
    `static short` | `row`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCalcField(java.lang.String name, java.lang.String formula)` add a calculated item to the data area
    `BookPivotField` | `addField(java.lang.String name, BookPivotArea area)` Returns the Field with the specified name.
    `BookPivotArea` | `getArea(short area)` Returns the Area object associated with the specified area value.
    `java.lang.String` | `getDataCaption()` return the data caption
    `java.lang.String` | `getErrorCaption()` return the error caption
    `BookPivotField` | `getField(int i)` Returns the Field located at the specified index.
    `BookPivotField` | `getField(java.lang.String name)` Deprecated. replaced by BookPivotRange.addField
    `int` | `getFieldCount()` Returns the number of Fields in the PivotRange.
    `java.lang.String` | `getMissingCaption()` return the null value caption
    `RangeArea` | `getRangeArea()` returns the boundary of the PivotRange
    `boolean` | `isCompact()` indicates if it is compact
    `boolean` | `isInGridZone()` indicates if the grid zone is set
    `boolean` | `isShowColGrandTotal()` Indicates if the col grand total is shown or not
    `boolean` | `isShowDrill()` indicate if drill is set or not
    `boolean` | `isShowHeader()` indicate if the header is shown or not
    `boolean` | `isShowRowGrandTotal()` Indicates if the row grand total is shown or not
    `void` | `refresh()` refresh the selected pivot range
    `void` | `refreshRange()` refresh the pivot table from the data source
    `void` | `setCompact(boolean in)` the compact flag is set if true
    `void` | `setConditionalFormat(ConditionFormat conditionFormat, int dataFiled, int selection)` apply the conditional formatting to the pivot table
    `void` | `setDataCaption(java.lang.String caption)` set the data caption
    `void` | `setDataOnRow(boolean onRow)` set the data field in the column area if flag is false.
    `void` | `setErrorCaption(boolean bUse, java.lang.String caption)` set the error caption
    `void` | `setInGridZone(boolean in)` the grid zone is set if true
    `void` | `setMissingCaption(boolean bUse, java.lang.String caption)` set the caption for the null values
    `void` | `setShowColGrandTotal(boolean total)` set the col grand total is shown if true
    `void` | `setShowDrill(boolean in)` the drill flag is set if true
    `void` | `setShowHeader(boolean in)` header is shown if true
    `void` | `setShowRowGrandTotal(boolean total)` set the row grand total is shown if true
    `void` | `setTableCustomStyle(java.lang.String style)` apply the custom table style to the pivot table,the style must be exist in the workbook
    `void` | `setTableFormat(RangeStyle rs, int selection)` format the selection part of the pivot table
    `void` | `setTableStyle(PivotBuiltInStyles style)`

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

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

- - ### Field Detail

    - #### row

          public static final short row

      See Also:
        Constant Field Values

    - #### column

          public static final short column

      See Also:
        Constant Field Values

    - #### page

          public static final short page

      See Also:
        Constant Field Values

    - #### areaBlankColumnHeader

          public static final short areaBlankColumnHeader

      See Also:
        Constant Field Values

    - #### areaData

          public static final short areaData

      See Also:
        Constant Field Values

    - #### areaAll

          public static final short areaAll

      See Also:
        Constant Field Values

    - #### areaTopLeft

          public static final short areaTopLeft

      See Also:
        Constant Field Values

    - #### areaHeaders

          public static final short areaHeaders

      See Also:
        Constant Field Values

    - #### data

          public static final short data

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### refreshRange

          public void refreshRange()

      refresh the pivot table from the data source

    - #### getArea

          public BookPivotArea getArea(short area)

      Returns the Area object associated with the specified area value.
      Parameters:
        `area` - Area valur
      Returns:
        Area.

    - #### getField

          public BookPivotField getField(java.lang.String name)

      Deprecated. replaced by BookPivotRange.addField
      Returns the Field with the specified name.
      Parameters:
        `name` - Name of the desired Field.
      Returns:
        Field with specified name.

    - #### addCalcField

          public void addCalcField(java.lang.String name,
                                   java.lang.String formula)

      add a calculated item to the data area
      Parameters:
        `name` - Name of the desired Field.
        `formula` - calculated field formula

    - #### addField

          public BookPivotField addField(java.lang.String name,
                                         BookPivotArea area)

      Returns the Field with the specified name.
      Parameters:
        `name` - Name of the desired Field.
        `area` - pivot area
      Returns:
        Field with specified name.

    - #### getField

          public BookPivotField getField(int i)

      Returns the Field located at the specified index.
      Parameters:
        `i` - Index to the desired Field.
      Returns:
        Field located at specified index.

    - #### getFieldCount

          public int getFieldCount()

      Returns the number of Fields in the PivotRange.
      Returns:
        Number of Fields in the PivotRange.

    - #### getRangeArea

          public RangeArea getRangeArea()

      returns the boundary of the PivotRange
      Returns:
        boundary

    - #### setDataOnRow

          public void setDataOnRow(boolean onRow)

      set the data field in the column area if flag is false.
      Parameters:
        `onRow` - true to set field in row area.

    - #### refresh

          public void refresh()
                       throws java.lang.Exception

      refresh the selected pivot range
      Throws:
        `java.lang.Exception` - if error occur

    - #### isShowRowGrandTotal

          public boolean isShowRowGrandTotal()

      Indicates if the row grand total is shown or not
      Returns:
        true i the row grand total is shown

    - #### setShowRowGrandTotal

          public void setShowRowGrandTotal(boolean total)

      set the row grand total is shown if true
      Parameters:
        `total` - true to set row grand total

    - #### isShowColGrandTotal

          public boolean isShowColGrandTotal()

      Indicates if the col grand total is shown or not
      Returns:
        true i the col grand total is shown

    - #### setShowColGrandTotal

          public void setShowColGrandTotal(boolean total)

      set the col grand total is shown if true
      Parameters:
        `total` - true to set col grand total

    - #### isCompact

          public boolean isCompact()

      indicates if it is compact
      Returns:
        true if the grid zone is set

    - #### setCompact

          public void setCompact(boolean in)

      the compact flag is set if true
      Parameters:
        `in` - true to set compact

    - #### isInGridZone

          public boolean isInGridZone()

      indicates if the grid zone is set
      Returns:
        true if the grid zone is set

    - #### setInGridZone

          public void setInGridZone(boolean in)

      the grid zone is set if true
      Parameters:
        `in` - true to set grid zone

    - #### isShowDrill

          public boolean isShowDrill()

      indicate if drill is set or not
      Returns:
        true if drill flag is set

    - #### setShowDrill

          public void setShowDrill(boolean in)

      the drill flag is set if true
      Parameters:
        `in` - true to set the drill flag

    - #### isShowHeader

          public boolean isShowHeader()

      indicate if the header is shown or not
      Returns:
        true to show header

    - #### setShowHeader

          public void setShowHeader(boolean in)

      header is shown if true
      Parameters:
        `in` - true to show header

    - #### getDataCaption

          public java.lang.String getDataCaption()

      return the data caption
      Returns:
        data caption

    - #### setDataCaption

          public void setDataCaption(java.lang.String caption)

      set the data caption
      Parameters:
        `caption` - data caption

    - #### getErrorCaption

          public java.lang.String getErrorCaption()

      return the error caption
      Returns:
        error caption

    - #### setErrorCaption

          public void setErrorCaption(boolean bUse,
                                      java.lang.String caption)

      set the error caption
      Parameters:
        `bUse` - true to use error caption
        `caption` - lable string

    - #### getMissingCaption

          public java.lang.String getMissingCaption()

      return the null value caption
      Returns:
        missing caption

    - #### setMissingCaption

          public void setMissingCaption(boolean bUse,
                                        java.lang.String caption)

      set the caption for the null values
      Parameters:
        `bUse` - true to use missing caption
        `caption` - lable string

    - #### setTableStyle

          public void setTableStyle(PivotBuiltInStyles style)

      Parameters:
        `style` - build-in style
      See Also:
        `PivotBuiltInStyles`

    - #### setTableCustomStyle

          public void setTableCustomStyle(java.lang.String style)

      apply the custom table style to the pivot table,the style must be exist in the workbook
      Parameters:
        `style` - style name

    - #### setTableFormat

          public void setTableFormat(RangeStyle rs,
                                     int selection)

      format the selection part of the pivot table
      Parameters:
        `rs` - formatting object
        `selection` - part of the pivot table 0-BlankColumnHeader 2-Data 3-all 4-TopLeft

    - #### setConditionalFormat

          public void setConditionalFormat(ConditionFormat conditionFormat,
                                           int dataFiled,
                                           int selection)

      apply the conditional formatting to the pivot table
      Parameters:
        `conditionFormat` - conditional formatting
        `dataFiled` - data field index
        `selection` - conditional type to be applied 0 - Selected cells 1 - All cells showing "#DATAFIELD" values 2 - All cells showing "#DATAFIELD" values for "#ROW_AREA_FIELDS" and "#COL_AREA_FIELDS"