Merge branch 'release/2.15.2.2409.01' into feature/自定义列全局设置
This commit is contained in:
commit
32b3ce97a9
|
|
@ -134,7 +134,7 @@ public class ExcelUtilPlus {
|
|||
rowZeroCell.setCellValue(columnGroupItem.getText().toString());
|
||||
rowZeroCell.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(i, Math.max(12, columnGroupItem.getText().length() * 4) * 256);
|
||||
sheet.setColumnWidth(i, Math.min(255, Math.max(12, columnGroupItem.getText().length() * 4)) * 256);
|
||||
patternList.add(columnGroupItem.getPattern());
|
||||
}
|
||||
|
||||
|
|
@ -262,7 +262,7 @@ public class ExcelUtilPlus {
|
|||
//遍历设置列宽
|
||||
List<Object> header = rowList.get(0);
|
||||
for (int i = 0; i < header.size(); i++) {
|
||||
sheet.setColumnWidth(i, Math.max(12, header.get(i).toString().length() * 4) * 256);
|
||||
sheet.setColumnWidth(i, Math.min(255, Math.max(12, header.get(i).toString().length() * 4)) * 256);
|
||||
}
|
||||
|
||||
for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) {
|
||||
|
|
@ -349,7 +349,7 @@ public class ExcelUtilPlus {
|
|||
//遍历设置列宽
|
||||
List<Object> header = rowList.get(0);
|
||||
for (int i = 0; i < header.size(); i++) {
|
||||
sheet.setColumnWidth(i, Math.max(12, header.get(i).toString().length() * 4) * 256);
|
||||
sheet.setColumnWidth(i, Math.min(255, Math.max(12, header.get(i).toString().length() * 4)) * 256);
|
||||
}
|
||||
|
||||
for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) {
|
||||
|
|
@ -454,7 +454,7 @@ public class ExcelUtilPlus {
|
|||
//遍历设置列宽
|
||||
List<Object> header = rowList.get(0);
|
||||
for (int i = 0; i < header.size(); i++) {
|
||||
sheet.setColumnWidth(i, Math.max(12, header.get(i).toString().length() * 4) * 256);
|
||||
sheet.setColumnWidth(i, Math.min(255, Math.max(12, header.get(i).toString().length() * 4)) * 256);
|
||||
}
|
||||
|
||||
for (int rowIndex = 0; rowIndex < rowList.size(); rowIndex++) {
|
||||
|
|
@ -588,7 +588,7 @@ public class ExcelUtilPlus {
|
|||
rowOneCell.setCellValue(columnGroupItem.getText().toString());
|
||||
rowOneCell.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(startIndex, Math.max(12, columnGroupItem.getText().length() * 4) * 256);
|
||||
sheet.setColumnWidth(startIndex, Math.min(255, Math.max(12, columnGroupItem.getText().length() * 4)) * 256);
|
||||
startIndex++;
|
||||
patternList.add(columnGroupItem.getPattern());
|
||||
} else {
|
||||
|
|
@ -610,7 +610,7 @@ public class ExcelUtilPlus {
|
|||
subHeader.setCellValue(childrenItem.getText().toString());
|
||||
subHeader.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(startIndex + j, Math.max(12, childrenItem.getText().length() * 4) * 256);
|
||||
sheet.setColumnWidth(startIndex + j, Math.min(255, Math.max(12, childrenItem.getText().length() * 4)) * 256);
|
||||
patternList.add(childrenItem.getPattern());
|
||||
}
|
||||
|
||||
|
|
@ -789,7 +789,7 @@ public class ExcelUtilPlus {
|
|||
rowOneCell.setCellValue(columnGroupItem.getText().toString());
|
||||
rowOneCell.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(startIndex, Math.max(12, columnGroupItem.getText().length() * 4) * 256);
|
||||
sheet.setColumnWidth(startIndex, Math.min(255, Math.max(12, columnGroupItem.getText().length() * 4)) * 256);
|
||||
startIndex++;
|
||||
} else {
|
||||
List<WeaTableColumnGroup> childrenList = columnGroupItem.getChildren();
|
||||
|
|
@ -810,7 +810,7 @@ public class ExcelUtilPlus {
|
|||
subHeader.setCellValue(childrenItem.getText().toString());
|
||||
subHeader.setCellStyle(titleCellStyle);
|
||||
//设置列宽
|
||||
sheet.setColumnWidth(startIndex + j, Math.max(12, childrenItem.getText().length() * 4) * 256);
|
||||
sheet.setColumnWidth(startIndex + j, Math.min(255, Math.max(12, childrenItem.getText().length() * 4)) * 256);
|
||||
}
|
||||
|
||||
startIndex += childrenList.size();
|
||||
|
|
|
|||
Loading…
Reference in New Issue