|
@@ -140,6 +140,7 @@ public class ExcelWriter extends ExcelExport {
|
|
|
font.setFontName("宋体");
|
|
|
font.setColor(IndexedColors.BLACK1.getIndex());
|
|
|
style.setFont(font);
|
|
|
+ XSSFCellStyle XSSFCellStyle = workbook.createCellStyle();
|
|
|
for (Object obj : dataset) {
|
|
|
index++;
|
|
|
row = sheet.createRow(index);// 创建行
|
|
@@ -147,7 +148,7 @@ public class ExcelWriter extends ExcelExport {
|
|
|
for (short i = 0; i < columnSettings.size(); i++) {
|
|
|
cell = row.createCell(i);// 创建列
|
|
|
Field field = columnSettings.get(i).getField();
|
|
|
- cell.setCellStyle(this.getCellStyle(workbook.createCellStyle(), field));
|
|
|
+ cell.setCellStyle(this.getCellStyle(XSSFCellStyle, field));
|
|
|
String methodName = columnSettings.get(i).getGetMethodName();
|
|
|
Method method = this.getDataClass().getMethod(methodName, new Class[]{});
|
|
|
Object value = method.invoke(obj, new Object[]{});
|