[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

LayoutRowType

Enum Class LayoutRowType

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

public enum LayoutRowType extends Enum<LayoutRowType>
指定数据透视表的行轴布局类型。

将此枚举与 IPivotTable.setRowAxisLayout(LayoutRowType) 一起使用,可更改数据透视表行轴的显示布局。默认布局为 CompactRow。

注意:如果布局设置为 TabularRow,则 SubtotalLocationType 只能设置为 SubtotalLocationType.Bottom。


 Object sourceData = new Object[][] {
     {"Order ID", "Product", "Category", "Amount"},
     {1, "Bose 785593-0050", "Consumer Electronics", 4270},
     {2, "Canon EOS 1500D", "Consumer Electronics", 8239},
     {3, "Iphone XR", "Mobile", 9062}
 };
 worksheet.getRange("A1:D4").setValue(sourceData);
 IPivotCache pivotcache = workbook.getPivotCaches().create(worksheet.getRange("A1:D4"));
 IPivotTable pivottable = worksheet.getPivotTables().add(pivotcache, worksheet.getRange("A6"), "pivottable1");
 pivottable.getPivotFields().get("Category").setOrientation(PivotFieldOrientation.RowField);
 pivottable.getPivotFields().get("Product").setOrientation(PivotFieldOrientation.RowField);
 pivottable.getPivotFields().get("Amount").setOrientation(PivotFieldOrientation.DataField);
 pivottable.setRowAxisLayout(LayoutRowType.TabularRow);
 
  • Enum Constant Details

    • CompactRow

      public static final LayoutRowType CompactRow
      紧凑行。
    • TabularRow

      public static final LayoutRowType TabularRow
      表格行。
    • OutlineRow

      public static final LayoutRowType OutlineRow
      大纲行。
  • Method Details

    • values

      public static LayoutRowType[] 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 LayoutRowType 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
    • getValue

      public int getValue()
      Gets the ordinal value of this layout type.
      Returns:
      The ordinal value.
    • forValue

      public static LayoutRowType forValue(int value)
      Gets the layout type that corresponds to the specified ordinal value.
      Parameters:
      value - The ordinal value.
      Returns:
      The matching layout type.