private void downloadWithXls(String fileName,HttpServletResponse response,XlsTemplateBuilder builder){
response.setContentType("application/x-download;charset=utf-8");
try {
fileName=URLEncoder.encode(fileName, "utf-8").replaceAll("\\+", "%20").replaceAll("%28", "\\(").replaceAll("%29", "\\)").replaceAll("%3B", ";").replaceAll("%40", "@").replaceAll("%23", "\\#").replaceAll("%26", "\\&");;
fileName+=".xls";
} catch (UnsupportedEncodingException e1) {
logger.error(e1.getMessage(),e1.fillInStackTrace());
}
response.addHeader("Content-Disposition","attachment;filename*=utf-8'zh_cn'" + fileName);
OutputStream outputStream;
try {
outputStream = response.getOutputStream();
builder.write(outputStream);
} catch (IOException e) {
logger.error(e.getMessage(),e.fillInStackTrace());
}
}