public class ChartDataWorkbook extends DomObject<ChartData> implements 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.
|
getParent_Immediatepublic final 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(); }
getWorksheets in interface IChartDataWorkbookpublic final IChartCellCollection getCellCollection(java.lang.String formula, boolean skipHiddenCells)
Gets the set of cells.
getCellCollection in interface IChartDataWorkbookformula - Excel formula like "Sheet1!$A$2:$A$5".skipHiddenCells - If true then method returns collection without hidden cells.IChartCellCollectionpublic final IChartDataCell getCell(java.lang.String worksheetName, int row, int column)
Gets the cell that can be used for chart series or categories
getCell in interface IChartDataWorkbookworksheetName - Name of the worksheet.row - The row.column - The column.public final IChartDataCell getCell(int worksheetIndex, int row, int column)
Gets the cell that can be used for chart series or categories
getCell in interface IChartDataWorkbookworksheetIndex - Index of the worksheet.row - The row.column - The column.public final IChartDataCell getCell(int worksheetIndex, java.lang.String cellName)
Gets the cell that can be used for chart series or categories
getCell in interface IChartDataWorkbookworksheetIndex - Index of the worksheet.cellName - Name of the cell.public final IChartDataCell getCell(int worksheetIndex, java.lang.String cellName, java.lang.Object value)
Gets the cell that can be used for chart series or categories
getCell in interface IChartDataWorkbookworksheetIndex - Index of the worksheet.cellName - Name of the cell.value - The value.public final IChartDataCell getCell(int worksheetIndex, int row, int column, java.lang.Object value)
Gets the cell that can be used for chart series or categories
getCell in interface IChartDataWorkbookworksheetIndex - Index of the worksheet.row - The row.column - The column.value - The value.public final void clear(int sheetIndex)
Clear all cells values on sheet
clear in interface IChartDataWorkbooksheetIndex - Index of sheetpublic final 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(); }
calculateFormulas in interface IChartDataWorkbookCellCircularReferenceException - Workbook contains formulas with a circular reference.CellUnsupportedDataException - Cell data is not supported.Copyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.