[]
        
(Showing Draft Content)

IPivotValueCell

Interface IPivotValueCell


public interface IPivotValueCell
Represents a PivotTable value cell and provides access to its value and related IPivotCell when an actual cell range is not available.

 worksheet.getRange("A1:C4").setValue(new Object[][] {
     {"Category", "Product", "Amount"},
     {"Fruit", "Apple", 100},
     {"Fruit", "Orange", 200},
     {"Vegetable", "Carrot", 150}
 });
 IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:C4"));
 IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("E1"), "SalesPivot");
 pivotTable.getPivotFields().get("Category").setOrientation(PivotFieldOrientation.RowField);
 pivotTable.getPivotFields().get("Amount").setOrientation(PivotFieldOrientation.DataField);
 IPivotValueCell valueCell = pivotTable.pivotValueCell(0, 0);
 IPivotCell pivotCell = valueCell.getPivotCell();
 Object value = valueCell.getValue();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the PivotCell that specifies the location of the PivotValueCell.
    Returns the value at the location.
  • Method Details

    • getPivotCell

      IPivotCell getPivotCell()
      Returns the PivotCell that specifies the location of the PivotValueCell. Read-only.
      
       IPivotValueCell valueCell = pivotTable.pivotValueCell(0, 0);
       IPivotCell pivotCell = valueCell.getPivotCell();
       IRange range = pivotCell.getRange();
       
      Returns:
      The PivotCell that specifies the location of the PivotValueCell.
    • getValue

      Object getValue()
      Returns the value at the location. The value is the value after ShowAs and other calculations have been applied. The returned object can represent a blank, numeric, date, text, or error value.
      
       IPivotValueCell valueCell = pivotTable.pivotValueCell(0, 0);
       Object value = valueCell.getValue();
       
      Returns:
      The value at the location.