说明:从数据库查询数据集写入数据到excel文件,并设置excel导出样式。记录一下,不喜勿喷。
@RequestMapping("/fileDown")
public @ResponseBody
WrappedResult fileDown(@RequestParam(value = "appNoQfbd") String appNoQfbd,@RequestParam(value = "eventCode") String eventCode,
@RequestParam(value = "ym") String ym,HttpServletResponse response,HttpServletRequest request) throws Exception {
GasfeeComCondition condition = new GasfeeComCondition();
condition.setAppNoQfbd(appNoQfbd);
condition.setEventCode(eventCode);
condition.setYm(ym);
gasfeeComService.fileDown(response, condition);
return new WrappedResult(true, true, "");
}
@SuppressWarnings("deprecation")
public void fileDown(HttpServletResponse response, GasfeeComCondition condition) throws IOException {
// create HSSFWorkbook EXCEL设置部分
HSSFWorkbook