[]
        
(Showing Draft Content)

PivotFieldOrientation

Enum Class PivotFieldOrientation

java.lang.Object
java.lang.Enum<PivotFieldOrientation>
com.grapecity.documents.excel.PivotFieldOrientation
All Implemented Interfaces:
Serializable, Comparable<PivotFieldOrientation>, Constable

public enum PivotFieldOrientation extends Enum<PivotFieldOrientation>
Specifies the location of a field in a PivotTable report.

Use this enum with IPivotField.setOrientation(PivotFieldOrientation) to place a pivot field in the row area, column area, page area, data area, or to hide the field.


 Object[][] sourceData = {
     {"Product", "Region", "Amount"},
     {"Apple", "East", 120},
     {"Apple", "West", 80},
     {"Orange", "East", 90}
 };
 worksheet.getRange("A1:C4").setValue(sourceData);
 IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:C4"));
 IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("E1"), "SalesPivot");
 pivotTable.getPivotFields().get("Region").setOrientation(PivotFieldOrientation.RowField);
 
  • Enum Constant Details

  • Method Details

    • values

      public static PivotFieldOrientation[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PivotFieldOrientation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null