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. Please note, methods in the monitor may be invoked multiple times for one object which contains the formula.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.
|
void |
onFormatConditionFormulaChanged(FormatCondition fc)
The event that will be triggered when the formula of FormatCondition 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 cellpublic void onFormatConditionFormulaChanged(FormatCondition fc)
fc - The FormatCondition object whose formula is changedSee 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 2003-2025. All Rights Reserved.