<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 6  文章 - 129  trackbacks - 0
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿(14)

    隨筆檔案(6)

    文章分類(467)

    文章檔案(423)

    相冊

    收藏夾(18)

    JAVA

    搜索

    •  

    積分與排名

    • 積分 - 825447
    • 排名 - 49

    最新評論

    閱讀排行榜

    評論排行榜

    部分代碼如下(POI的版本為3.2)
    public void insertRow() throws IOException {

          POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream("workbook.xls"));
           HSSFWorkbook wb = new HSSFWorkbook(fs);
           HSSFSheet sheet = wb.getSheet("new sheet");
          int starRow = 4;
          int rows = 5;
         
            sheet.shiftRows(starRow + 1, sheet.getLastRowNum(), rows,true,false);
            //Parameters:
            //startRow - the row to start shifting
            //endRow - the row to end shifting
            //n - the number of rows to shift
            //copyRowHeight - whether to copy the row height during the shift
            //resetOriginalRowHeight - whether to set the original row's height to the default
          
            starRow = starRow - 1;

            for (int i = 0; i < rows; i++) {
             HSSFRow sourceRow = null;
             HSSFRow targetRow = null;
             HSSFCell sourceCell = null;
             HSSFCell targetCell = null;
             short m;
             starRow = starRow + 1;
             sourceRow = sheet.getRow(starRow);
             targetRow = sheet.createRow(starRow + 1);
             targetRow.setHeight(sourceRow.getHeight());
     
             for (m = sourceRow.getFirstCellNum(); m < sourceRow.getLastCellNum(); m++) {
             sourceCell = sourceRow.getCell(m);
             targetCell = targetRow.createCell(m);
     
             //targetCell.setEncoding(sourceCell.getEncoding());
             targetCell.setCellStyle(sourceCell.getCellStyle());
             targetCell.setCellType(sourceCell.getCellType());
             targetCell.setCellValue(i);//設置值
             }
           }
         FileOutputStream fileOut = new FileOutputStream("workbook.xls");
            wb.write(fileOut);
            fileOut.close();
       }

    參考了http://blog.csdn.net/daemon_boy/archive/2007/09/15/1786384.aspx的代碼

    posted on 2009-04-16 16:43 Ke 閱讀(10808) 評論(0)  編輯  收藏 所屬分類: java excel

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 嘿嘿嘿视频免费网站在线观看| 中国在线观看免费国语版| 亚洲情a成黄在线观看动漫尤物| 真人做人试看60分钟免费视频| 亚洲av永久中文无码精品综合| 国产成人高清亚洲| 99爱在线精品免费观看| 一级做a爰全过程免费视频毛片| 亚洲黄色免费在线观看| 亚洲精品色播一区二区| 亚洲中文久久精品无码ww16| 在线成人爽a毛片免费软件| 亚洲Av无码国产一区二区| 亚洲国产精品无码久久SM| 在线中文高清资源免费观看| a毛片全部免费播放| 亚洲国产精品无码久久| 亚洲邪恶天堂影院在线观看| 国产成人3p视频免费观看| 污视频在线免费观看| 高潮毛片无遮挡高清免费| 亚洲人成综合在线播放| 国产日产亚洲系列| 国产网站在线免费观看| 免费在线观看h片| 国产成人精品日本亚洲专一区| 国内精品99亚洲免费高清| 18禁成年无码免费网站无遮挡| 久久国产精品一区免费下载| 美女扒开尿口给男人爽免费视频| 亚洲成人免费电影| 国产自产拍精品视频免费看| 亚洲免费电影网站| 182tv免费视频在线观看| 青青青视频免费观看| 亚洲av中文无码乱人伦在线r▽ | 成人毛片免费网站| 久久精品人成免费| 中文字幕无码毛片免费看| 另类专区另类专区亚洲| 亚洲欧美成aⅴ人在线观看|