POI生成Excel强制换行
2024-10-12 20:59:54
自动换行的设置:
HSSFCellStyle cellStyle=workbook.createCellStyle();
cellStyle.setWrapText(true);
cell.setCellStyle(cellStyle);
强制换行:
<pre name="code" class="html">HSSFCell cell = row.createCell((short)0);
cell.setCellStyle(cellStyle);
cell.setCellValue(new HSSFRichTextString("hello/r/n world!"));
修改代码如码如下
HSSFCell cell = row.createCell((short)0);
cellStyle.setWrapText(true);//先设置为自动换行
cell.setCellStyle(cellStyle);
cell.setCellValue(new HSSFRichTextString("hello/r/n world!"));
最新文章
- Android中BroadcastReceiver的两种注册方式(静态和动态)详解
- 初次认识 C# win32 api
- Swift_String的操作
- 警告 - no rule to process file &#39;WRP_CollectionView/README.md&#39; of type net.daringfireball.markdown for architecture i386
- PostgreSQL: 一种用于生成随机字符串的方法
- API 版本控制
- MySQL全世界最流行的开源数据库软件
- win8 Pro 64位在 UEFI模式下Ghost系统 备份 恢复
- .NET c# 串口通信
- Duanxx的Altium Designer学习:PCB试想一下,在目前的水平
- service structure flowchart with full stack functionality in a brife map
- perl的列表(List)和数组(Array)
- springMVC源码分析--国际化LocaleResolver(一)
- springboot全局捕获异常
- Visualizing the Git data model
- centos安装RabbitMQ 3.7.9 (使用RPM)
- CentOS 7 休眠系统
- Java备份文件
- 关于div文字点击编辑的插件
- JavaScript 第二章总结