< listValues.size(); i++) {
                Row row = sheet.createRow(i + 1);
                setRow(cellTitle, cellValue, workBook, sheet, style, listValues.get(i), i, row);
            }
        }
        return workBook;
    }
    private static void setRow(String[] cellTitle, String[] cellValue,
                               SXSSFWorkbook workBook, Sheet sheet, XSSFCellStyle style, Map map, int line, Row row) {
        for (int j = 0; j < cellTitle.length; j++) {
            // 在上面行索引0的位置创建单元格
            //XSSFCell cell = titleRow.createCell(i, 0);
            Cell cell = row.createCell(j, CellType.STRING);
            // 定义单元格为字符串类型
            //cell.setCellType(XSSFCell.CELL_TYPE_STRING);
            cell.setCellType(CellType.STRING);
            //取出列表值
            cell.setCellValue(getMapString(map, cellValue[j]));
            //style.setAlignment(XSSFCellStyle.ALIGN_CENTER);
            style.setAlignment(HorizontalAlignment.CENTER);
            cell.setCellStyle(style);
        }
    }
    /**
     * 输出文件到客户端
     * <功能详细描述>
     *
     * @param rsp      http响应对象
     * @param bytes
     * @param fileName
     * @see [类、类#方法、类#成员]
     */
    public static void writeDocResponse(HttpServletResponse rsp, byte[] bytes, String fileName) {
        try (OutputStream out = rsp.getOutputStream();) {
            //扩展名获取ContentType
            rsp.setContentType("application/vnd.ms-excel");
            String fileNameURL = URLEncoder.encode(fileName, "UTF-8");
            String contentHeader = "attachment; filename=" + fileNameURL + ";" + "filename*=utf-8''" + fileNameURL;
            rsp.setHeader("Content-disposition", contentHeader);
            //文件写入
            out.write(bytes, 0, bytes.length);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public static String getMapString(Map map, String key) {
        return map.get(key) == null ? null : String.valueOf(map.get(key));
    }
}
    
     
 
      
 
       
 
      
