导出excel
来源:互联网 发布:软件开发个人简历 编辑:程序博客网 时间:2024/05/16 05:59
控制层操作;
//导出excel@RequestMapping("/toExcel")public void downLoadExcel(HttpServletRequest request, HttpServletResponse response){String fileName = "生长适宜性指数";List<Map<String, Object>> listmap = new ArrayList<Map<String, Object>>();Map<String, Object> map = new HashMap<String, Object>();map.put("sheetName", "sheet1");listmap.add(map);Exponent exponent = null;for (int j = 0; j <list.size(); j++) {exponent = list.get(j);Map<String, Object> mapValue = new HashMap<String, Object>();mapValue.put("年份",exponent.getDT());mapValue.put("地区",exponent.getAREA());mapValue.put("作物名称",exponent.getFName());mapValue.put("站名",exponent.getSName());mapValue.put("站号",exponent.getSNO());mapValue.put("发育期",exponent.getPhase());mapValue.put("24小时生长适宜性",exponent.getI24());mapValue.put("48小时生长适宜性",exponent.getI48());mapValue.put("72小时生长适宜性",exponent.getI72());mapValue.put("96小时生长适宜性",exponent.getI96());listmap.add(mapValue);}String columnNames[] = {"年份","地区","作物名称","站名","站号","发育期","24小时生长适宜性","48小时生长适宜性","72小时生长适宜性","96小时生长适宜性"};// 列名String keys[] = {"年份","地区","作物名称","站名","站号","发育期","24小时生长适宜性","48小时生长适宜性","72小时生长适宜性","96小时生长适宜性"};// map中的keytry {ExportExcel.download(request, response, listmap, fileName, columnNames, keys);} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}
js代码:
//导出Exccel function pmgressbar(){//进度条 var win = $.messager.progress({ title : '请稍等', msg : '正在导出中...', }); setTimeout(function(){ $.messager.progress("close"); },600) } function onClick_download(){ //alert(11) $.messager.confirm("确认","确认将搜索到的数据导出为Excel表格?",function(r){ if(r){ url="/SX_LGQX/exponent/toExcel.do"; location.href=url; pmgressbar(); } }); }
0 0
- 导出EXCEL
- Excel导出
- 导出Excel
- 导出EXCEL
- 导出Excel
- EXCEL导出
- 导出Excel
- 导出excel
- 导出excel
- EXCEL导出
- 导出excel
- 导出Excel
- Excel导出。
- 导出excel
- Excel 导出
- 导出excel
- 导出excel
- 导出excel
- 如何给安卓APP安装听诊器,检查数据问题
- Android-Activity类
- 【Malaysia】【Cet】马来西亚
- openstack学习笔记3
- centos下nginx编译安装
- 导出excel
- Unity实战 RTS3D即时战略游戏开发(十二) 战斗AI的控制
- pdf添加目录
- HashMap和HashSet的区别
- 年鉴注册码
- web网页嵌入qt中
- html5在微信浏览器下调用复制功能
- Maven中央仓库地址总结
- 【认证】【德国】德国莱茵集团(TÜV Rheinland)颁发的智能电视认证