|
|
@@ -814,7 +814,7 @@ public class ExcelUtil<T>
|
|
814
|
814
|
*/
|
|
815
|
815
|
public void annotationDataStyles(Map<String, CellStyle> styles, Field field, Excel excel)
|
|
816
|
816
|
{
|
|
817
|
|
- String key = StringUtils.format("data_{}_{}_{}_{}", excel.align(), excel.color(), excel.backgroundColor(), excel.cellType());
|
|
|
817
|
+ String key = StringUtils.format("data_{}_{}_{}_{}_{}", excel.align(), excel.color(), excel.backgroundColor(), excel.cellType(), excel.wrapText());
|
|
818
|
818
|
if (!styles.containsKey(key))
|
|
819
|
819
|
{
|
|
820
|
820
|
CellStyle style = wb.createCellStyle();
|
|
|
@@ -830,6 +830,7 @@ public class ExcelUtil<T>
|
|
830
|
830
|
style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
|
|
831
|
831
|
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
|
832
|
832
|
style.setFillForegroundColor(excel.backgroundColor().getIndex());
|
|
|
833
|
+ style.setWrapText(excel.wrapText());
|
|
833
|
834
|
Font dataFont = wb.createFont();
|
|
834
|
835
|
dataFont.setFontName("Arial");
|
|
835
|
836
|
dataFont.setFontHeightInPoints((short) 10);
|
|
|
@@ -858,7 +859,7 @@ public class ExcelUtil<T>
|
|
858
|
859
|
if (isSubList())
|
|
859
|
860
|
{
|
|
860
|
861
|
// 填充默认样式,防止合并单元格样式失效
|
|
861
|
|
- sheet.setDefaultColumnStyle(column, styles.get(StringUtils.format("data_{}_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor(), attr.cellType())));
|
|
|
862
|
+ sheet.setDefaultColumnStyle(column, styles.get(StringUtils.format("data_{}_{}_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor(), attr.cellType(), attr.wrapText())));
|
|
862
|
863
|
if (attr.needMerge())
|
|
863
|
864
|
{
|
|
864
|
865
|
sheet.addMergedRegion(new CellRangeAddress(rownum - 1, rownum, column, column));
|
|
|
@@ -990,7 +991,7 @@ public class ExcelUtil<T>
|
|
990
|
991
|
sheet.addMergedRegion(new CellRangeAddress(subMergedFirstRowNum, subMergedLastRowNum, column, column));
|
|
991
|
992
|
}
|
|
992
|
993
|
}
|
|
993
|
|
- cell.setCellStyle(styles.get(StringUtils.format("data_{}_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor(), attr.cellType())));
|
|
|
994
|
+ cell.setCellStyle(styles.get(StringUtils.format("data_{}_{}_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor(), attr.cellType(), attr.wrapText())));
|
|
994
|
995
|
|
|
995
|
996
|
// 用于读取对象中的属性
|
|
996
|
997
|
Object value = getTargetValue(vo, field, attr);
|