导出Excel中文名

/**

     * 

     * @Title: exportExcel

     * @Description: TODO(导出Excel输出流)

     * @param @param fileName

     * @param @param wb

     * @param @param response 设定文件

     * @return void 返回类型

     * @throws

     */

    public void exportExcel(String fileName, HSSFWorkbook wb,

   HttpServletResponse response) {

try {

   response.setContentType("application/ms-excel;");

   response.setHeader("Content-disposition", "attachment;filename="

   + new String(fileName.getBytes("gb2312"), "ISO-8859-1") + ".xls");

   OutputStream ouputStream = response.getOutputStream();

   wb.write(ouputStream);

   ouputStream.flush();

   ouputStream.close();

} catch (IOException e) {

   e.printStackTrace();

}

    }

你可能感兴趣的:(导出Excel中文名)