zoukankan      html  css  js  c++  java
  • spring-excel-导出

    导出

    1导出策略

    2导出模板

    3writer

    应用

        @Autowired(required = false)
        @Qualifier("monthlyPairBillingStatementExportWriter")
        private ExcelWriter monthlyPairBillingStatementExportWriter;
    @RequestMapping("/monthlyPairBillingStatementExport.do")
    public void monthlyPairBillingStatementExport(HttpServletResponse response,String ids) throws IOException {
    SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
    String dateString = formatter.format(new Date());
    String fileName = new String(("报价导入模板"+dateString+".xlsx").getBytes("utf-8"),"ISO8859-1");
    response.setCharacterEncoding("utf-8");
    response.setContentType("multipart/form-data");
    response.setHeader("Content-Disposition", "attachment;fileName="+fileName);

    Map<String, Object> map = new HashMap<>();
    if(StringUtils.isNotEmpty(ids)){
    map.put("ids",ids);
    }
    Map<String, Object> exportMap = new HashMap<String, Object>();
    //List<FinMonthConnBillVo> finMonthConnBillVos =this.finMonthConnBillService.monthlyPairBillingStatementExportQuery(map);
    //ssexportMap.put("monthlyPairBillingStatementExport_Moddle", finMonthConnBillVos);
    monthlyPairBillingStatementExportWriter.write(response.getOutputStream(), exportMap);
    }

    其中writer.write(

    response.getOutputStream()

    ,key为策略名,value为策略vo集合的map)

    js 调用

    window.location.href = "../fosp/monthlyPairBillingStatementExport.do";
  • 相关阅读:
    常见的位运算技巧总结(膜wys)
    BZOJ1878:[SDOI2009]HH的项链
    BZOJ4300:绝世好题
    BZOJ1298:[SCOI2009]骰子的学问
    BZOJ2748:[HAOI2012]音量调节
    BZOJ1951:[SDOI2010]古代猪文
    BZOJ1002:[FJOI2007]轮状病毒
    BZOJ1081:[SCOI2005]超级格雷码
    BZOJ2595:[WC2008]游览计划
    BZOJ1190:[HNOI2007]梦幻岛宝石
  • 原文地址:https://www.cnblogs.com/zfzf1/p/7409793.html
Copyright © 2011-2022 走看看