https://bz.apache.org/bugzilla/show_bug.cgi?id=60260

            Bug ID: 60260
           Summary: shiftRows exception at rowShifter.updateNamedRanges
           Product: POI
           Version: 3.15-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: tuyen...@gmail.com

Created attachment 34376
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34376&action=edit
excel file used in test code

I meet excetion when shift rows in sheet name Sheet・1 and named_range
test_named_range include sheet name

I add file in attactment and code used (tested with 3.15 and 3.16-beta1)

    @Test
    public void testShiftRows() throws IOException {
        String in = "data/book2.xlsx";
        try (XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream(in))) {
            XSSFSheet sheet = wb.getSheetAt(0);
            sheet.shiftRows(1, 2, 3);
        }
    }

Exception message:

org.apache.poi.ss.formula.FormulaParseException: Specified named range 'Sheet'
does not exist in the current workbook.
    at
org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:898)
    at
org.apache.poi.ss.formula.FormulaParser.parseRangeable(FormulaParser.java:490)
    at
org.apache.poi.ss.formula.FormulaParser.parseRangeExpression(FormulaParser.java:311)
    at
org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:1509)
    at
org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:1467)
    at
org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:1454)
    at org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:1827)
    at
org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1955)
    at
org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1939)
    at
org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1896)
    at
org.apache.poi.ss.formula.FormulaParser.intersectionExpression(FormulaParser.java:1869)
    at
org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1849)
    at org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1997)
    at org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:170)
    at
org.apache.poi.xssf.usermodel.helpers.XSSFRowShifter.updateNamedRanges(XSSFRowShifter.java:91)
    at org.apache.poi.xssf.usermodel.XSSFSheet.shiftRows(XSSFSheet.java:3068)
    at org.apache.poi.xssf.usermodel.XSSFSheet.shiftRows(XSSFSheet.java:2925)
    at test.poi.TestExcel.testShiftRows(TestExcel.java:69)

Thank you very much for reading and support

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to