Commit 172fae59 authored by 李贺贺's avatar 李贺贺

对账单打印格式优化

parent 83d6fe57
......@@ -61,7 +61,7 @@ public class ExcelFormatUtil {
Font font1 = wb.createFont();
font1.setFontName("黑体");
style1.setFont(font1);
//style1.setWrapText(true);
style1.setWrapText(true);
style1.setAlignment(HorizontalAlignment.LEFT);
style1.setVerticalAlignment(VerticalAlignment.CENTER);
return style1;
......@@ -117,7 +117,7 @@ public class ExcelFormatUtil {
//设置每一列的字段名
cell.setCellValue(title);
cell.setCellStyle(header);
CellRangeAddress region = new CellRangeAddress(firstRow, firstRow+1, firstrCol, 9);
CellRangeAddress region = new CellRangeAddress(firstRow, firstRow+1, firstrCol, 7);
sheet.addMergedRegion(region);
}
......@@ -130,7 +130,7 @@ public class ExcelFormatUtil {
//设置每一列的字段名
cell.setCellValue(content);
cell.setCellStyle(contentType);
CellRangeAddress region = new CellRangeAddress(firstRow, firstRow, firstrCol, 9);
CellRangeAddress region = new CellRangeAddress(firstRow, firstRow, firstrCol, 7);//删除最后一列
sheet.addMergedRegion(region);
}
......@@ -139,11 +139,11 @@ public class ExcelFormatUtil {
SXSSFRow row = sheet.createRow(firstRow);
for(int j = 1;j<=title.length; j++) {
SXSSFCell cell = row.createCell(j);
SXSSFCell cell = row.createCell(j-1);
//设置每一列的字段名
cell.setCellValue(title[j-1]);
cell.setCellStyle(contentTable);
sheet.setColumnWidth(j, titleLength[j-1]);
sheet.setColumnWidth(j-1, titleLength[j-1]);
}
}
......
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