|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils
public final class XSSFFormulaUtils
Utility to update formulas and named ranges when a sheet name was changed
Constructor Summary | |
---|---|
XSSFFormulaUtils(XSSFWorkbook wb)
|
Method Summary | |
---|---|
void |
updateSheetName(int sheetIndex,
java.lang.String name)
Update sheet name in all formulas and named ranges. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XSSFFormulaUtils(XSSFWorkbook wb)
Method Detail |
---|
public void updateSheetName(int sheetIndex, java.lang.String name)
XSSFWorkbook.setSheetName(int, String)
The idea is to parse every formula and render it back to string with the updated sheet name. The FormulaParsingWorkbook passed to the formula parser is constructed from the old workbook (sheet name is not yet updated) and the FormulaRenderingWorkbook passed to FormulaRenderer#toFormulaString is a custom implementation that returns the new sheet name.
sheetIndex
- the 0-based index of the sheet being changedname
- the new sheet name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |