锘??xml version="1.0" encoding="utf-8" standalone="yes"?>中文字幕一区图,99热精品一区二区,国产精品久久不能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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 绵阳市| 罗平县| 资中县| 阿克陶县| 峡江县| 闻喜县| 旺苍县| 商都县| 会昌县| 井陉县| 淳安县| 淮北市| 广东省| 亚东县| 银川市| 张家口市| 高淳县| 靖安县| 如皋市| 图们市| 砀山县| 武清区| 安多县| 枝江市| 平阴县| 尚志市| 乌鲁木齐县| 兴隆县| 莎车县| 海阳市| 轮台县| 江安县| 浙江省| 那曲县| 永泰县| 江北区| 丁青县| 乐亭县| 静安区| 资兴市| 楚雄市|