HSSFWorkBooK用法 做excle导出excle
来源:互联网 发布:决战武林天罡进阶数据 编辑:程序博客网 时间:2024/06/09 22:48
@RequestMapping(value = "exportExcel") public void exportExcel(BizUserArchive bizUserArchive,HttpServletRequest request, HttpServletResponse response) { // bizUserArchiveService.export2ExcelInfo(request, response); HSSFWorkbook wb = new HSSFWorkbook();//创建excle HSSFSheet sheet = wb.createSheet("new sheet");//创建sheet工作表对象(编号从0开始) HSSFCellStyle style = wb.createCellStyle(); // 样式对象 style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);// 垂直样式 style.setAlignment(HSSFCellStyle.ALIGN_CENTER);// 水平样式 // 设置字体 HSSFFont font = wb.createFont(); font.setFontHeightInPoints((short) 36);// 字体大小 //列宽 sheet.setColumnWidth(0, 3000); sheet.setColumnWidth(1, 3500); bizUserArchive = bizUserArchiveService.loadArchiveByUserId(bizUserArchive); HSSFRow row0 = sheet.createRow((short) 0);//第一行 row0.setHeight((short) 500); // 行高 HSSFCell cell0 = row0.createCell(0); //第一行第一列 cell0.setCellValue(new HSSFRichTextString("姓名")); HSSFCell cell1 = row0.createCell(1); //第一行第二列 cell1.setCellValue(bizUserArchive.getPersonName()); // loadArchiveByUserId response.setContentType("application/vnd.ms-excel"); OutputStream ouputStream=null;try {ouputStream = response.getOutputStream();wb.write(ouputStream); ouputStream.flush(); ouputStream.close(); } catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();} }
阅读全文
0 0
- HSSFWorkBooK用法 做excle导出excle
- HSSFWorkbook手写excle报表
- Excle导出
- 导出EXCLE
- excle导出
- 导出excle
- excle导出
- excle导出
- Excle
- Excle
- excle
- 数据导出Excle
- 数据导出Excle !
- SQL导出Excle 心得
- CSVWriter----excle导出示例
- C#导出Excle文件
- 类对象导出excle
- 导出excle,乱码解决
- win10专业版激活(试试水)
- Hadoop伪集群搭建
- 【广州云栖大数据/人工智能会场信息】全新一代人工智能引擎MaxCompute惊艳全场
- chrome performance 使用
- kotlin以及as3.0中新的添加依赖
- HSSFWorkBooK用法 做excle导出excle
- Aras innovator: 怎样把excel文件导入到Aras数据库
- 真正搞懂传值引用和传指针引用
- 架构和框架的区别
- 数据结构<八>: 数组实现的线程表
- 输出一个整数的每一位
- 解决安装Liunx后Windows引导丢失的问题
- Android图片加载框架最全解析(七),实现带进度的Glide图片加载功能
- SpringBoot 多模块项目(module)Service自动注入(@Autowired)