[]
        
(Showing Draft Content)

PivotFieldCustomGroupOptions

Class PivotFieldCustomGroupOptions

java.lang.Object
com.grapecity.documents.excel.PivotFieldCustomGroupOptions

public class PivotFieldCustomGroupOptions extends Object
Represents the settings used to create a custom group from PivotItems in a PivotField.

Use this class to configure the item names, optional group name, and whether generated group fields are automatically added to the PivotTable layout by IPivotField.group(PivotFieldCustomGroupOptions).


 PivotFieldCustomGroupOptions options = new PivotFieldCustomGroupOptions();
 options.setName("Fruit Group");
 options.setItems(java.util.Arrays.asList("Apple", "Banana"));
 String name = options.getName();
 
  • Constructor Details

    • PivotFieldCustomGroupOptions

      public PivotFieldCustomGroupOptions()
  • Method Details

    • getItems

      public List<String> getItems()
      Gets the source PivotItem names to include in the new custom group.

      The returned list is a copy. Modifying it does not change this object; use setItems(List) to update the grouped items.

      
       PivotFieldCustomGroupOptions options = new PivotFieldCustomGroupOptions();
       options.setItems(java.util.Arrays.asList("Apple"));
       List<String> items = options.getItems();
       
      Returns:
      The source PivotItem names to include in the new custom group.
    • setItems

      public void setItems(List<String> value)
      Sets the source PivotItem names to include in the new custom group.

      The list must contain at least one item name when grouping is applied. Source names, item names, and captions are matched without case sensitivity.

      
       PivotFieldCustomGroupOptions options = new PivotFieldCustomGroupOptions();
       options.setItems(java.util.Arrays.asList("Apple"));
       List<String> items = options.getItems();
       
      Parameters:
      value - The source PivotItem names to include in the new custom group. Use null to clear the item list.
    • getName

      public String getName()
      Gets the display name of the created custom group.
      
       PivotFieldCustomGroupOptions options = new PivotFieldCustomGroupOptions();
       options.setName("Fruit Group");
       String name = options.getName();
       
      Returns:
      The display name of the created custom group. Returns null if the default group name is used.
    • setName

      public void setName(String value)
      Sets the display name of the created custom group.

      If this value is null or empty, a default group name is used when grouping is applied. If the name already exists, grouping fails.

      
       PivotFieldCustomGroupOptions options = new PivotFieldCustomGroupOptions();
       options.setName("Fruit Group");
       String name = options.getName();
       
      Parameters:
      value - The display name of the created custom group.
    • getAddGeneratedFieldsToLayout

      public boolean getAddGeneratedFieldsToLayout()
      Gets whether generated group fields are automatically added to the PivotTable layout.
      
       PivotFieldCustomGroupOptions options = new PivotFieldCustomGroupOptions();
       options.setAddGeneratedFieldsToLayout(false);
       boolean addGeneratedFields = options.getAddGeneratedFieldsToLayout();
       
      Returns:
      true if generated group fields are automatically added to the PivotTable layout; otherwise, false. The default value is true.
    • setAddGeneratedFieldsToLayout

      public void setAddGeneratedFieldsToLayout(boolean value)
      Sets whether generated group fields are automatically added to the PivotTable layout.
      
       PivotFieldCustomGroupOptions options = new PivotFieldCustomGroupOptions();
       options.setAddGeneratedFieldsToLayout(false);
       boolean addGeneratedFields = options.getAddGeneratedFieldsToLayout();
       
      Parameters:
      value - true to add generated group fields to the PivotTable layout automatically; false to keep them hidden.