Bläddra i källkod

web-报表导出调整

liao-sea 3 månader sedan
förälder
incheckning
1233396949
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. 3 3
      src/main/java/com/hz/employmentsite/util/ExcelHelper.java

+ 3 - 3
src/main/java/com/hz/employmentsite/util/ExcelHelper.java

@@ -231,7 +231,7 @@ public class ExcelHelper {
         }
         rowIndex = writeColspanTitlesToExcel(wb, sheet, data.getColspanTitles(), data.getTitles());
         writeRowsToExcel(wb, sheet, data.getRows(), rowIndex, data.getStyleList());
-        //autoSizeColumns(sheet, data.getTitles().size() + 1);
+        autoSizeColumns(sheet, data.getTitles().size() + 1);
 
         //合并行
         if (data.getCellRangeList() != null && data.getCellRangeList().size() > 0) {
@@ -332,8 +332,8 @@ public class ExcelHelper {
         dataFont.setColor(IndexedColors.BLACK.index);
 
         XSSFCellStyle defaultStyle = wb.createCellStyle();
-        //dataStyle.setAlignment(HorizontalAlignment.CENTER);
-        //dataStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        defaultStyle.setAlignment(HorizontalAlignment.CENTER);
+        defaultStyle.setVerticalAlignment(VerticalAlignment.CENTER);
         defaultStyle.setFont(dataFont);
         setBorder(defaultStyle, BorderStyle.THIN, new XSSFColor(new java.awt.Color(188, 188, 188), new DefaultIndexedColorMap()));