<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

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


    網站導航:
     
    主站蜘蛛池模板: 91大神亚洲影视在线| 久久av无码专区亚洲av桃花岛| 国产日韩在线视频免费播放| 亚洲AV日韩AV高潮无码专区| 欧洲精品成人免费视频在线观看 | 在线观看人成视频免费| 日韩精品免费一线在线观看| 亚洲伊人久久大香线蕉苏妲己| 思思99re66在线精品免费观看| a级毛片免费网站| 亚洲成a人片7777| 亚洲片国产一区一级在线观看| 一区二区三区观看免费中文视频在线播放| 狠狠色伊人亚洲综合网站色| 亚洲精品无码久久久久sm| 久久不见久久见中文字幕免费| igao激情在线视频免费 | 岛国精品一区免费视频在线观看 | mm1313亚洲精品国产| 69av免费视频| 三上悠亚在线观看免费| 亚洲国产精华液2020| 麻豆亚洲AV永久无码精品久久| 免费国产不卡午夜福在线| 曰批全过程免费视频播放网站| 中美日韩在线网免费毛片视频| 亚洲乱码在线播放| 亚洲国产无套无码av电影| 国产精品无码一二区免费| 免费黄色网址网站| 日韩精品无码免费专区午夜不卡| 亚洲av永久无码| 亚洲人成在线播放| 亚洲AV一宅男色影视| 亚洲片一区二区三区| 卡1卡2卡3卡4卡5免费视频| 3d动漫精品啪啪一区二区免费| 久久嫩草影院免费看夜色| 国产精品亚洲五月天高清| 亚洲中文无码永久免费| 亚洲理论片在线观看|