gpt4 book ai didi

java - 无法理解 apache POI 的 shiftRows 方法的工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:39:28 24 4
gpt4 key购买 nike

我正在处理 .xls 文件,我打算将 excel 表的行转换(移位)到特定位置。但每次都得到不需要的结果。我已经阅读了方法 shiftRows 的文档。无法理解此语句的工作原理。

sheet.shiftRows(34, sheet.getLastRowNum(), processIndex-4);

有时它会在 Excel 表格中移动两行。

最佳答案

        sheet.shiftRows(int startRow, int endRow, int n);

用于在工作表中向下移动行数。在哪里

  • startRow =我们需要插入行的位置。
  • endRows = 总行数
  • n = 我们要插入多少行

org.apache.poi.ss.usermodel.Sheet.shiftRows 的 javadoc提供更多详细信息。

关于java - 无法理解 apache POI 的 shiftRows 方法的工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35793635/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com