freemark 导出word

论坛 期权论坛 脚本     
已经匿名di用户   2022-3-21 23:58   2231   0
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

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:81
帖子:4969
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP