IChartDataWorkbook

public interface IChartDataWorkbook

Provides access to embedded Excel workbook

Methods

MethodDescription
calculateFormulas()Calculates all formulas in the workbook and updates corresponding cells values.
getCellCollection(String formula, boolean skipHiddenCells)Gets the set of cells.
getCell(String worksheetName, int row, int column)Gets the cell that can be used for chart series or categories
getCell(int worksheetIndex, int row, int column)Gets the cell that can be used for chart series or categories
getCell(int worksheetIndex, String cellName)Gets the cell that can be used for chart series or categories
getCell(int worksheetIndex, String cellName, Object value)Gets the cell that can be used for chart series or categories
getCell(int worksheetIndex, int row, int column, Object value)Gets the cell that can be used for chart series or categories
clear(int sheetIndex)Clear all cells values on sheet
getWorksheets()Gets a collection of worksheets.

calculateFormulas()

public abstract void calculateFormulas()

Calculates all formulas in the workbook and updates corresponding cells values.


Example shows how to assign a formula to the cell and to calculate a value. The value of the "B4" cell is getting set to 5.
  
  Presentation pres = new Presentation();
  try {
      IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 100, 100, 300, 400);
      IChartDataWorkbook wb = chart.getChartData().getChartDataWorkbook();
      wb.getCell(0, "B2", 2);
      wb.getCell(0, "B3", 3);
      wb.getCell(0, "B4").setFormula("B2+B3");
      wb.calculateFormulas();
      ...
  } finally {
      if (pres != null) pres.dispose();
  }

getCellCollection(String formula, boolean skipHiddenCells)

public abstract IChartCellCollection getCellCollection(String formula, boolean skipHiddenCells)

Gets the set of cells.

Parameters:

ParameterTypeDescription
formulajava.lang.StringExcel formula like “Sheet1!$A$2:$A$5”.
skipHiddenCellsbooleanIf true then method returns collection without hidden cells.

Returns: IChartCellCollection - Set of cells IChartCellCollection

getCell(String worksheetName, int row, int column)

public abstract IChartDataCell getCell(String worksheetName, int row, int column)

Gets the cell that can be used for chart series or categories

Parameters:

ParameterTypeDescription
worksheetNamejava.lang.StringName of the worksheet.
rowintThe row.
columnintThe column.

Returns: IChartDataCell - Cell object

getCell(int worksheetIndex, int row, int column)

public abstract IChartDataCell getCell(int worksheetIndex, int row, int column)

Gets the cell that can be used for chart series or categories

Parameters:

ParameterTypeDescription
worksheetIndexintIndex of the worksheet.
rowintThe row.
columnintThe column.

Returns: IChartDataCell - Cell object

getCell(int worksheetIndex, String cellName)

public abstract IChartDataCell getCell(int worksheetIndex, String cellName)

Gets the cell that can be used for chart series or categories

Parameters:

ParameterTypeDescription
worksheetIndexintIndex of the worksheet.
cellNamejava.lang.StringName of the cell.

Returns: IChartDataCell - Cell object

getCell(int worksheetIndex, String cellName, Object value)

public abstract IChartDataCell getCell(int worksheetIndex, String cellName, Object value)

Gets the cell that can be used for chart series or categories

Parameters:

ParameterTypeDescription
worksheetIndexintIndex of the worksheet.
cellNamejava.lang.StringName of the cell.
valuejava.lang.ObjectThe value.

Returns: IChartDataCell - Cell object

getCell(int worksheetIndex, int row, int column, Object value)

public abstract IChartDataCell getCell(int worksheetIndex, int row, int column, Object value)

Gets the cell that can be used for chart series or categories

Parameters:

ParameterTypeDescription
worksheetIndexintIndex of the worksheet.
rowintThe row.
columnintThe column.
valuejava.lang.ObjectThe value.

Returns: IChartDataCell - Cell object

clear(int sheetIndex)

public abstract void clear(int sheetIndex)

Clear all cells values on sheet

Parameters:

ParameterTypeDescription
sheetIndexintIndex of sheet

getWorksheets()

public abstract IChartDataWorksheetCollection getWorksheets()

Gets a collection of worksheets.


Example:
 
 Presentation pres = new Presentation();
 try {
     IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Pie, 50, 50, 400, 500);
     IChartDataWorkbook workbook =  chart.getChartData().getChartDataWorkbook();
     for (IChartDataWorksheet worksheet : workbook.getWorksheets())
     {
         String worksheetName = worksheet.getName();
     }
 } finally {
     if (pres != null) pres.dispose();
 }

Returns: IChartDataWorksheetCollection