首页 > 编程语言 > 详细

java工具类-excel jxl

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

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!