public abstract class AbstractFormulaChangeMonitor
extends java.lang.Object
Remarks
For example, while deleting/inserting range of cells, formulas of other cells may be changed because of the shift of references.Example
class MyFormulaChangeMonitor extends AbstractFormulaChangeMonitor
{
private final WorksheetCollection mWorksheets;
public MyFormulaChangeMonitor(WorksheetCollection worksheets)
{
mWorksheets = worksheets;
}
public /*override*/ void onCellFormulaChanged(int sheetIndex, int rowIndex, int columnIndex)
{
System.out.println("Cell " + mWorksheets.get(sheetIndex).getName() + "!"
+ CellsHelper.cellIndexToName(rowIndex, columnIndex)
+ "'s formula was changed while inserting rows.");
}
}
Workbook wb = new Workbook("template.xlsx");
InsertOptions options = new InsertOptions();
options.setFormulaChangeMonitor(new MyFormulaChangeMonitor(wb.getWorksheets()));
wb.getWorksheets().get(0).getCells().insertRows(0, 2, options);
| Constructor and Description |
|---|
AbstractFormulaChangeMonitor() |
| Modifier and Type | Method and Description |
|---|---|
void |
onCellFormulaChanged(int sheetIndex,
int rowIndex,
int columnIndex)
The event that will be triggered when the formula in a cell is changed.
|
public void onCellFormulaChanged(int sheetIndex,
int rowIndex,
int columnIndex)
sheetIndex - The sheet index of the changed cellrowIndex - The row index of the changed cellcolumnIndex - The column index of the changed cellSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2001-2023. All Rights Reserved.