public interface IChartDataWorkbook
Provides access to embedded Excel workbook
Modifier and Type | Method and Description |
---|---|
void |
calculateFormulas()
Calculates all formulas in the workbook and updates corresponding cells values.
|
void |
clear(int sheetIndex)
Clear all cells values on sheet
|
IChartDataCell |
getCell(int worksheetIndex,
int row,
int column)
Gets the cell that can be used for chart series or categories
|
IChartDataCell |
getCell(int worksheetIndex,
int row,
int column,
java.lang.Object value)
Gets the cell that can be used for chart series or categories
|
IChartDataCell |
getCell(int worksheetIndex,
java.lang.String cellName)
Gets the cell that can be used for chart series or categories
|
IChartDataCell |
getCell(int worksheetIndex,
java.lang.String cellName,
java.lang.Object value)
Gets the cell that can be used for chart series or categories
|
IChartDataCell |
getCell(java.lang.String worksheetName,
int row,
int column)
Gets the cell that can be used for chart series or categories
|
IChartCellCollection |
getCellCollection(java.lang.String formula,
boolean skipHiddenCells)
Gets the set of cells.
|
IChartDataWorksheetCollection |
getWorksheets()
Gets a collection of worksheets.
|
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(); }
CellCircularReferenceException
- Workbook contains formulas with a circular reference.CellUnsupportedDataException
- Cell data is not supported.IChartCellCollection getCellCollection(java.lang.String formula, boolean skipHiddenCells)
Gets the set of cells.
formula
- Excel formula like "Sheet1!$A$2:$A$5".skipHiddenCells
- If true then method returns collection without hidden cells.IChartCellCollection
IChartDataCell getCell(java.lang.String worksheetName, int row, int column)
Gets the cell that can be used for chart series or categories
worksheetName
- Name of the worksheet.row
- The row.column
- The column.IChartDataCell getCell(int worksheetIndex, int row, int column)
Gets the cell that can be used for chart series or categories
worksheetIndex
- Index of the worksheet.row
- The row.column
- The column.IChartDataCell getCell(int worksheetIndex, java.lang.String cellName)
Gets the cell that can be used for chart series or categories
worksheetIndex
- Index of the worksheet.cellName
- Name of the cell.IChartDataCell getCell(int worksheetIndex, java.lang.String cellName, java.lang.Object value)
Gets the cell that can be used for chart series or categories
worksheetIndex
- Index of the worksheet.cellName
- Name of the cell.value
- The value.IChartDataCell getCell(int worksheetIndex, int row, int column, java.lang.Object value)
Gets the cell that can be used for chart series or categories
worksheetIndex
- Index of the worksheet.row
- The row.column
- The column.value
- The value.void clear(int sheetIndex)
Clear all cells values on sheet
sheetIndex
- Index of sheetIChartDataWorksheetCollection 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(); }