Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用现有的HSSFWorkBook(Apache POI)并在具有新值的两个现有行之间插入新行。我尝试使用sheet.shiftRows(n1, n2, n3),但在移动值后它会覆盖。我该怎么做?
HSSFWorkBook
sheet.shiftRows(n1, n2, n3)
我认为通常的方法是将所有其他行向下移动,然后将新数据写入留下的行。
因此,如果您想在第 14 行和第 15 行之间添加两行,请将第 15 行的行向下移动 2,然后将新值写入第 15 行和第 16 行。(您的旧第 15 行将是第 17 行)