[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(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>
指定数据透视表报表中字段的位置。

将此枚举与 IPivotField.setOrientation(PivotFieldOrientation)一起使用,可以将数据透视字段放置在行区域、列区域、页区域、数据区域,或隐藏该字段。


 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