首页>代码>java读取WORD/EXCEL模板转换生成新WORD/EXCEL文档>/office/src/main/java/me/jtx/office/impl/ExcelOfficeDocumentImpl.java
package me.jtx.office.impl; import java.util.Map; import net.sf.jxls.transformer.XLSTransformer; import me.jtx.office.ExcelOfficeDocument; /** * @author JSTHZX * */ public class ExcelOfficeDocumentImpl implements ExcelOfficeDocument { public boolean generateDocument(String templateFileName, String destFileName, Map<String, Object> map) { try { XLSTransformer transformer = new XLSTransformer(); transformer.transformXLS(templateFileName, map, destFileName); } catch (Exception ex) { ex.printStackTrace(); return false; } return true; } }