`
53873039oycg
  • 浏览: 823865 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论

[简单]poi3.11 shifted row关于批注的bug

    博客分类:
  • poi
 
阅读更多

       网上删除行代码:

      

 /**
 * Remove a row by its index
 * @param sheet a Excel sheet
 * @param rowIndex a 0 based index of removing row
 */
public static void removeRow(Sheet sheet, int rowIndex) {
    int lastRowNum=sheet.getLastRowNum();
    if(rowIndex>=0&&rowIndex<lastRowNum){
        sheet.shiftRows(rowIndex+1,lastRowNum, -1);
    }
    if(rowIndex==lastRowNum){
        Row removingRow=sheet.getRow(rowIndex);
        if(removingRow!=null){
            sheet.removeRow(removingRow);
        }
    }
}

   在要删除的行下面其他行存在批注内容是,打开excel会报错,如图:

   

      删除第2行,打开excel时报错:

     

     修复后:

    

       修复后>=2行里的批注全部删除,此bug在poi-3.11存在,在poi-3.12-bea1存在,目前尚未修复。

       官网关于此bug的记录:https://bz.apache.org/bugzilla/show_bug.cgi?id=56017

       只能等poi-3.12下一版本了。

       全文完。

 

 

  • 大小: 25.3 KB
  • 大小: 84.4 KB
  • 大小: 39.1 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics