当前位置: 首页 > news >正文

springboot 下载文件为excel数据,中文自定义单元格宽度

/**2      * @Description:表格自适应宽度(中文支持)3      * @Author: 4      * @param sheet sheet5      * @param columnLength 列数6      */7     private static void setSizeColumn(HSSFSheet sheet, int columnLength) {8         for (int columnNum = 0; columnNum <= columnLength; columnNum++) {9             int columnWidth = sheet.getColumnWidth(columnNum) / 256;
10             for (int rowNum = 0; rowNum < sheet.getLastRowNum(); rowNum++) {
11                 HSSFRow currentRow; // 当前行未被使用过
12                 if (sheet.getRow(rowNum) == null) {
13                     currentRow = sheet.createRow(rowNum);
14                 } else {
15                     currentRow = sheet.getRow(rowNum);
16                 }
17                 if (currentRow.getCell(columnNum) != null) {
18                     HSSFCell currentCell = currentRow.getCell(columnNum);
19                     if (currentCell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
20                         int length = currentCell.getStringCellValue().getBytes().length;
21                         if (columnWidth < length) {
22                             columnWidth = length;
23                         }
24                     }
25                 }
26             }
27             sheet.setColumnWidth(columnNum, columnWidth * 256);
28         }
29     }

Flowable工作流6.3.0 项目实战_flowable项目实战_马艳鹏学java的博客-CSDN博客

RuoYi-flowable: 🌟 基于RuoYi-vue + flowable 6.7.2 的工作流管理 右上角点个 star、fork 🌟 持续关注更新哟 农业认养商城系统:https://gitee.com/tony2y/smart-breed智慧景区管理系统 :https://gitee.com/tony2y/scenic-spot

springboot集成flowable简单实例入门_flowable接口文档_cherry有点甜·的博客-CSDN博客 

http://www.lryc.cn/news/178652.html

相关文章:

  • 机器学习 面试/笔试题
  • 某企查ymg_ssr列表详情
  • 使用YOLOv5的backbone网络识别图像天气 - P9
  • TikTok海外扩张:亚马逊的新对手崛起
  • CSS详细基础(五)选择器的优先级
  • LLM-TAP随笔——有监督微调【深度学习】【PyTorch】【LLM】
  • kafka伪集群部署,使用docker环境拷贝模式
  • 工业交换机一般的价格是多少呢?
  • QT使用前的知识
  • Unity制作旋转光束
  • 考研王道强化阶段(二轮复习)“算法题”备考打卡表 记录
  • UE4/5数字人MetaHuman通过已有动画进行修改
  • 在Mac M2本地注册GitLab runner
  • 「大数据-2.2」使用命令操作HDFS文件系统
  • 面试买书复习就能进大厂?
  • 使用Http Interface客户端解析text/html类型参数
  • Linux - linux命令进阶
  • 排序篇(一)----插入排序
  • 通俗讲解深度学习轻量网络MobileNet-v1/v2/v3
  • mmpretrain学习笔记
  • rhel8 网络操作学习
  • 有车型(CarModel),车厂(CarFactory),经销商(Distributor)三个表
  • Python函数:chr()和ord()
  • flink sql 使用
  • ​面试官:谈谈 Go 泛型编程
  • 脚手架开发流程详解
  • 架构真题2021(四十三)
  • 数据统计和分析怎么做?spss如何做好数据分析?
  • 【多线程】线程安全的集合类
  • Goby 漏洞发布|Revive Adserver 广告管理系统 adxmlrpc.php 文件远程代码执行漏洞(CVE-2019-5434)