https://issues.apache.org/bugzilla/show_bug.cgi?id=46700
Summary: FormulaParseException thrown, when XSSFRow.shift(...) is
called.
Product: POI
Version: 3.5-dev
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
AssignedTo: [email protected]
ReportedBy: [email protected]
Created an attachment (id=23249)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=23249)
excel file for test
I use POI to open the attached "test.xlsx", call XSSFRow.shift(...) to shift 1
row. But if failed and throw FormulaParseException, it may be caused by the
named ranged specified in the formula.
Sample Code:
--
Workbook wb = new XSSFWorkbook("test.xlsx");
Sheet sheet = wb.getSheet("Test");
sheet.shiftRows(4, sheet.getLastRowNum(), 1, true, true);
wb.write(new FileOutputStream("output.xlsx"));
Exception Details:
--
org.apache.poi.ss.formula.FormulaParser$FormulaParseException: Specified named
range 'HSI' does not exist in the current workbook.
at
org.apache.poi.ss.formula.FormulaParser.parseNameOrCellRef(FormulaParser.java:440)
at
org.apache.poi.ss.formula.FormulaParser.parseRangeExpression(FormulaParser.java:336)
at
org.apache.poi.ss.formula.FormulaParser.parseFunctionReferenceOrName(FormulaParser.java:332)
at
org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:733)
at
org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:693)
at
org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:680)
at org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:982)
at
org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1083)
at
org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1067)
at
org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1024)
at
org.apache.poi.ss.formula.FormulaParser.Arguments(FormulaParser.java:665)
at
org.apache.poi.ss.formula.FormulaParser.function(FormulaParser.java:562)
at
org.apache.poi.ss.formula.FormulaParser.parseFunctionReferenceOrName(FormulaParser.java:324)
at
org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:733)
at
org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:693)
at
org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:680)
at org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:982)
at
org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1083)
at
org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1067)
at
org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1024)
at
org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1003)
at
org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1125)
at
org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:192)
at org.apache.poi.xssf.usermodel.XSSFRow.shiftFormula(XSSFRow.java:454)
at org.apache.poi.xssf.usermodel.XSSFRow.shift(XSSFRow.java:426)
at
org.apache.poi.xssf.usermodel.XSSFSheet.shiftRows(XSSFSheet.java:1457)
at com.dttn.excel.connector.TestPOI.main(TestPOI.java:98)
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]