| | |
| | | CellStyle newStyle = workbook.createCellStyle(); |
| | | newStyle.cloneStyleFrom(style); |
| | | newStyle.setWrapText(true); // 关键:启用自动换行 |
| | | cell.setCellStyle(newStyle); |
| | | cell.setCellStyle(style); |
| | | |
| | | // 用于读取对象中的属性 |
| | | Object value = getTargetValue(vo, field, attr); |
| | |
| | | // 设置列类型 |
| | | setCellVo(value, attr, cell); |
| | | } |
| | | adjustRowHeightAfterSetValue(row, cell, value); |
| | | adjustRowHeightAfterSetValue(row, cell, value); |
| | | addStatisticsData(column, Convert.toStr(value), attr); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | short baseHeight = (short) Math.max(currentHeight, autoHeight); |
| | | System.out.println(baseHeight+"aaaaaaaaatttttttt"); |
| | | // 4. 在基础上增加额外高度(100单位 = 5点) |
| | | short extraHeight = 80; |
| | | short extraHeight = 20; |
| | | short newHeight = (short) (baseHeight + extraHeight); |
| | | |
| | | // 5. 限制最大高度 |