Commit 51ef5643 authored by 宋源硕's avatar 宋源硕

Merge branch 'songyuanshuo' into 'master'

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

See merge request !21
parents 0c428301 cd3140de
......@@ -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