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

对账单打印格式优化

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