Class XSSFFormulaUtils
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils
-
public final class XSSFFormulaUtils extends java.lang.Object
Utility to update formulas and named ranges when a sheet name was changed
-
-
Constructor Summary
Constructors Constructor Description XSSFFormulaUtils(XSSFWorkbook wb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
updateSheetName(int sheetIndex, java.lang.String oldName, java.lang.String newName)
Update sheet name in all charts, formulas and named ranges.
-
-
-
Constructor Detail
-
XSSFFormulaUtils
public XSSFFormulaUtils(XSSFWorkbook wb)
-
-
Method Detail
-
updateSheetName
public void updateSheetName(int sheetIndex, java.lang.String oldName, java.lang.String newName)
Update sheet name in all charts, formulas and named ranges. Called fromXSSFWorkbook.setSheetName(int, String)
The idea is to parse every formula and render it back to string with the updated sheet name. This is done by parsing into Ptgs, looking for ones with sheet references in them, and changing those
- Parameters:
sheetIndex
- the 0-based index of the sheet being changedoldName
- the old sheet namenewName
- the new sheet name
-
-