码迷,mamicode.com
首页 > 编程语言 > 详细

java工具类-excel jxl

时间:2014-07-29 12:30:06      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:java   os   io   for   ar   new   file   public   

jxl-2.6.9.14.jar
import net.sf.jxls.transformer.XLSTransformer;//jxls-core-1.0.2.jar
import java.io.File;
 public File inputFile;
     Workbook workbook = WorkbookFactory.create(inputFile);
    Sheet sheet0 = workbook.getSheetAt(0);
    
    int rowNum = sheet0.getLastRowNum() + 1;
    for (int i = 1; i < rowNum; i++) {
     Row row = sheet0.getRow(i);
     Cell cell = row.createCell(lastCell);
     cell.setCellValue("");
    }
    File outputFile = new File("");
    FileOutputStream fo = new FileOutputStream(outputFile);
    workbook.write(fo);
    fo.close();
    
    
     XLSTransformer former = new XLSTransformer();
     Map beanParams = new HashMap();
     former.transformXLS(templatePath + exportTemplate, beanParams, outputPath + exportTemplate);

java工具类-excel jxl,布布扣,bubuko.com

java工具类-excel jxl

标签:java   os   io   for   ar   new   file   public   

原文地址:http://www.cnblogs.com/heling/p/3874733.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!