poi 3.11版本,最多65536条
来源:互联网 发布:php .net哪个好 编辑:程序博客网 时间:2024/06/18 14:02
需求:点击按钮,下载user数据表中的所有数据到excel中
1.pom坐标
<!-- POI-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11</version>
</dependency>
2.controller代码(下载excel)
String filename=new String("客户表.xlsx".getBytes(),"ISO-8859-1"); response.setHeader("Content-Disposition", "attachment;filename="+filename); ServletOutputStream sos = response.getOutputStream(); HSSFWorkbook book=new HSSFWorkbook(); HSSFSheet sheet = book.createSheet(); Workbook wb = new SXSSFWorkbook(100); HSSFRow titlerow = sheet.createRow(0); //设置标题 titlerow.createCell(0).setCellValue("编号"); titlerow.createCell(1).setCellValue("公司名称"); titlerow.createCell(2).setCellValue("姓名"); titlerow.createCell(3).setCellValue("部门"); titlerow.createCell(4).setCellValue("email"); titlerow.createCell(5).setCellValue("邮政编码"); titlerow.createCell(6).setCellValue("地址"); titlerow.createCell(7).setCellValue("次行业"); List<User> list = $userService().getAll(); for(int i=0;i<list.size();i++){ User user = list.get(i); HSSFRow datarow = sheet.createRow(i+1); datarow.createCell(0).setCellValue(user.getId()); datarow.createCell(1).setCellValue(user.getCompanyName()); datarow.createCell(2).setCellValue(user.getName()); datarow.createCell(3).setCellValue(user.getDept()); datarow.createCell(4).setCellValue(user.getEmaill()); datarow.createCell(5).setCellValue(user.getPostalcode()); datarow.createCell(6).setCellValue(user.getAddress()); datarow.createCell(7).setCellValue(user.getSecondIndustry()); } book.write(sos);} catch(Exception e){ e.printStackTrace();}3.前端写一个界面,点击访问此类即可
0 0
- poi 3.11版本,最多65536条
- 3.11 poi导出大量数据(最多导入65536条)
- POI处理超过65536条记录
- poi excel版本问题
- poi的各个版本
- kk 最多吃多少条虫子?
- 使用poi低版本(poi-3.0.1)导出Excel整理
- Excel每个Worksheet最多只能有65636条记录
- sql语句统计最大值和选择最多的10条
- 每个Worksheet最多只能有65636条记录
- 查看你使用最多的10条shell命令
- N条直线相交交点、分割的最多平面问题
- 测试XP下最多可生产多少条进程(Process)
- oracle 选取出现次数最多的前5条数据
- n条直线最多能划分出多少个平面?
- ecshop查询搜索记录最多的前10条
- dede arclist标签怎么最多只能输出10条
- mysql 查询重复次数最多/最少的几条记录
- Gradle 构建 android项目及APK打包(ubuntu)
- 仿微信 个人头像修改 popPopupWindow实现Menus从底部弹出
- Qt 状态机框架学习
- ffmpeg命令行批量转换视频
- Java基础加强
- poi 3.11版本,最多65536条
- 51单片机—串口时钟
- Android插件化和热修复的区别和联系
- 在jsp中使用js获取session中的对象的例子。
- 青蛙王子
- Vue+webpack学习案例(一)-构建Vue项目
- Programming on Winodows with Python (I) -- Get/Set window property
- 微信 静默 授权登录 获取openid 实现方法
- Windows 下下载和安装Apache,APache的下载