Commit cd3140de authored by yuanshuo's avatar yuanshuo

1./Plan/Record/exportTo接口修改,生成Excel的尺寸

parent 0c428301
......@@ -259,7 +259,12 @@ public class ExcelMultipleSheetsUtil {
Cell serialCell = sheet.getRow(startRowForSerial).createCell(0);
serialCell.setCellValue(serialNumber);
serialCell.setCellStyle(getCenteredWrapTextStyle(sheet.getWorkbook()));
}
sheet.setColumnWidth(0,20*200);
sheet.setColumnWidth(1,20*500);
sheet.setColumnWidth(2,20*500);
sheet.setColumnWidth(3,20*700);
}
......@@ -410,14 +415,19 @@ public class ExcelMultipleSheetsUtil {
chapterCell.setCellStyle(getCenteredWrapTextStyle(sheet.getWorkbook())); // 应用自动换行样式
}
sheet.setColumnWidth(0,20*150);
sheet.setColumnWidth(1,20*500);
sheet.setColumnWidth(2,20*500);
sheet.setColumnWidth(3,20*700);
sheet.setColumnWidth(4,20*200);
// 自动调整列宽以适应内容
for (int i = 0; i < 5; i++) {
/*for (int i = 0; i < 5; i++) {
sheet.autoSizeColumn(i);
if (i == 2){
sheet.setColumnWidth(1,20*256);
}
}
}*/
}
// 设置表格样式
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment