com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Interface IChartDataWorkbook

  • All Known Implementing Classes:
    ChartDataWorkbook


    public interface IChartDataWorkbook

    Provides access to embedded Excel workbook

    • Method Detail

      • calculateFormulas

        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();
          }
          
        Throws:
        CellCircularReferenceException - Workbook contains formulas with a circular reference.
        CellUnsupportedDataException - Cell data is not supported.
      • getCellCollection

        IChartCellCollection getCellCollection(java.lang.String formula,
                                               boolean skipHiddenCells)

        Gets the set of cells.

        Parameters:
        formula - Excel formula like "Sheet1!$A$2:$A$5".
        skipHiddenCells - If true then method returns collection without hidden cells.
        Returns:
        Set of cells IChartCellCollection
      • getCell

        IChartDataCell getCell(java.lang.String worksheetName,
                               int row,
                               int column)

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

        Parameters:
        worksheetName - Name of the worksheet.
        row - The row.
        column - The column.
        Returns:
        Cell object
      • getCell

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

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

        Parameters:
        worksheetIndex - Index of the worksheet.
        row - The row.
        column - The column.
        Returns:
        Cell object
      • getCell

        IChartDataCell getCell(int worksheetIndex,
                               java.lang.String cellName)

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

        Parameters:
        worksheetIndex - Index of the worksheet.
        cellName - Name of the cell.
        Returns:
        Cell object
      • getCell

        IChartDataCell getCell(int worksheetIndex,
                               java.lang.String cellName,
                               java.lang.Object value)

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

        Parameters:
        worksheetIndex - Index of the worksheet.
        cellName - Name of the cell.
        value - The value.
        Returns:
        Cell object
      • getCell

        IChartDataCell getCell(int worksheetIndex,
                               int row,
                               int column,
                               java.lang.Object value)

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

        Parameters:
        worksheetIndex - Index of the worksheet.
        row - The row.
        column - The column.
        value - The value.
        Returns:
        Cell object
      • clear

        void clear(int sheetIndex)

        Clear all cells values on sheet

        Parameters:
        sheetIndex - Index of sheet
      • getWorksheets

        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();
         }