shifting all rows from row no 3 to row no 2 (upward) breaks the formulas in all rows in XSSF sheet using POI java

huangapple go评论73阅读模式
英文:

shifting all rows from row no 3 to row no 2 (upward) breaks the formulas in all rows in XSSF sheet using POI java

问题

第1行是标题行。使用POI 4.1.2或5.0.0将从第3行到第2行的所有行(约100行以上)向上移动,会将公式转换为纯文本。

    XSSFSheet sheet = workbook.getSheet(sheetName);
    
    sheet.shiftRows(headerRow + 2, sheet.getLastRowNum(), -1);

我期望在移除第二行后,公式能够正常工作。

英文:

Row number 1 is the header row. Shifting all rows (approx 100 plus) upward from row 3 to row 2 using POI 4.1.2 or 5.0.0 converts the formula to plain text.

    XSSFSheet sheet = workbook.getSheet(sheetName);
    
    sheet.shiftRows(headerRow + 2, sheet.getLastRowNum(), -1);

I expect the formulas to work properly post removing the second row.

答案1

得分: 0

升级POI到5.2.3和commons-io到2.11.0之后,它正常工作了,谢谢@AxelRichter。

英文:

After upgrading POI to 5.2.3 and commons-io to 2.11.0, it worked, thanks @AxelRichter.

huangapple
  • 本文由 发表于 2023年7月3日 23:24:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76606149.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定