public void exportUserByWord(HttpServletRequest request, HttpServletResponse response) {
List<InfoBean> infos = new ArrayList<InfoBean>();
InfoBean infoBean = new InfoBean();
for(int i=0;i<10;i++){
infoBean.setXh("中文"+i);
infos.add(infoBean);
}
Map<String, Object> dataMap = new HashMap<String, Object>();
String ftlName = "ds.ftl";
String outFileName = "档案与文档团队xxxx年x月归档月报.doc";
//String outFileName = "aaa.doc";
dataMap.put("userList", infos);
//导出word
WordUtils.outPutData(response, ftlName, outFileName, dataMap);
}
工具类文件地址:https://download.csdn.net/download/u013774699/18124568 |