try {
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.setHeader("Content-Disposition", "attachment; filename=" +teamQuery.getTeamId()+ new String(" 項目銷量.xls".getBytes("gbk"), "iso8859-1"));
Boolean flag = manteamService.downFile(teamQuery,response.getOutputStream());
if (flag) {
resutMap.put("success", true);
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
一定要有response.getOutputStream()
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.setHeader("Content-Disposition", "attachment; filename=" +teamQuery.getTeamId()+ new String(" 項目銷量.xls".getBytes("gbk"), "iso8859-1"));
Boolean flag = manteamService.downFile(teamQuery,response.getOutputStream());
if (flag) {
resutMap.put("success", true);
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
一定要有response.getOutputStream()