|
@@ -163,20 +163,21 @@ public class ExportUtils {
|
|
|
if(!"".equals(title)){//标题行
|
|
|
row = sheet.createRow((int) rowIndex);// 行数从0开始
|
|
|
row.setHeightInPoints(30);//设置行的高度
|
|
|
- XSSFCell celldesc = row.createCell(0);
|
|
|
+ cell = row.createCell(0);
|
|
|
+ cell.setCellValue(StringUtil.ObjectToString(title));
|
|
|
+ cell.setCellStyle(descCellStyle);
|
|
|
sheet.addMergedRegion(new CellRangeAddress(0,0,0,titleArray.length - 1));//合并单元格
|
|
|
- celldesc.setCellValue(StringUtil.ObjectToString(title));
|
|
|
- celldesc.setCellStyle(descCellStyle);
|
|
|
+
|
|
|
rowIndex ++;
|
|
|
}
|
|
|
if(!"".equals(descStr)){//描述行
|
|
|
//添加描述行
|
|
|
row = sheet.createRow((int) rowIndex);// 行数从0开始
|
|
|
row.setHeightInPoints(30);//设置行的高度
|
|
|
- XSSFCell celldesc = row.createCell(0);
|
|
|
+ cell = row.createCell(0);
|
|
|
+ cell.setCellValue(StringUtil.ObjectToString(descStr));
|
|
|
+ cell.setCellStyle(descCellStyle);
|
|
|
sheet.addMergedRegion(new CellRangeAddress(0,0,0,titleArray.length - 1));//合并单元格
|
|
|
- celldesc.setCellValue(StringUtil.ObjectToString(descStr));
|
|
|
- celldesc.setCellStyle(descCellStyle);
|
|
|
rowIndex++;
|
|
|
}
|
|
|
int manyTitle = 1;// 表头默认一行
|
|
@@ -204,6 +205,7 @@ public class ExportUtils {
|
|
|
}
|
|
|
}
|
|
|
rowLock = rowIndex;
|
|
|
+ //固定标题列
|
|
|
sheet.createFreezePane(0, rowLock, 0, 0);
|
|
|
int rowLength = 0; //导出excel的总行数
|
|
|
if(ii < favg){
|