锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国语对白精品一区二区,国产三级伦理在线,一级视频在线观看视频在线啦啦http://www.aygfsteel.com/keweibo/category/39083.htmlAs long as you are there to lead me ,I won't lose my way zh-cnThu, 16 Apr 2009 12:09:33 GMTThu, 16 Apr 2009 12:09:33 GMT60浣跨敤POI寰EXCEL涓彃鍏ヨhttp://www.aygfsteel.com/keweibo/articles/265998.htmlKEKEThu, 16 Apr 2009 08:43:00 GMThttp://www.aygfsteel.com/keweibo/articles/265998.htmlhttp://www.aygfsteel.com/keweibo/comments/265998.htmlhttp://www.aygfsteel.com/keweibo/articles/265998.html#Feedback0http://www.aygfsteel.com/keweibo/comments/commentRss/265998.htmlhttp://www.aygfsteel.com/keweibo/services/trackbacks/265998.html閮ㄥ垎浠g爜濡備笅(POI鐨勭増鏈負(fù)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);//璦疆鍊?br />          }
       }
     FileOutputStream fileOut = new FileOutputStream("workbook.xls");
        wb.write(fileOut);
        fileOut.close();
   }

鍙傝冧簡http://blog.csdn.net/daemon_boy/archive/2007/09/15/1786384.aspx鐨勪唬鐮?/span>

KE 2009-04-16 16:43 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 武山县| 军事| 进贤县| 大方县| 平舆县| 安达市| 疏附县| 铜陵市| 洛宁县| 湖南省| 永德县| 韩城市| 奇台县| 墨竹工卡县| 沈丘县| 柳江县| 芦溪县| 平遥县| 宁蒗| 微博| 英吉沙县| 剑阁县| 蒙城县| 梨树县| 乌恰县| 北碚区| 临漳县| 吕梁市| 龙川县| 西贡区| 宝兴县| 甘孜| 蛟河市| 富顺县| 农安县| 合肥市| 蕲春县| 营山县| 铜梁县| 翁源县| 正阳县|