锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美日韩中文字幕一区二区,91色视频在线,国产第一页在线视频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鐨勭増鏈負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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 潼关县| 阿克陶县| 曲阜市| 霍州市| 贵南县| 惠水县| 建湖县| 拜城县| 三门峡市| 盖州市| 泰兴市| 云南省| 新龙县| 澄江县| 定结县| 三穗县| 昂仁县| 丰都县| 漯河市| 尉氏县| 颍上县| 永清县| 大石桥市| 宁海县| 八宿县| 神木县| 临桂县| 依兰县| 策勒县| 蒙城县| 吴桥县| 安化县| 和平区| 新兴县| 绥芬河市| 南雄市| 怀柔区| 沁水县| 崇仁县| 浏阳市| 屏山县|