From c9f9afe8f7476d4e0d68804f66530111418ffa92 Mon Sep 17 00:00:00 2001 From: gengxiaokai Date: Thu, 22 Nov 2018 15:18:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A9=9A=E6=A3=80=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/lyms/platform/common/utils/ExcelUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java b/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java index 98f355f..df941c8 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java +++ b/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java @@ -662,6 +662,7 @@ public class ExcelUtil WritableFont wf = new WritableFont(WritableFont.ARIAL, 12, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK); WritableCellFormat wcf = new WritableCellFormat(wf); wcf.setAlignment(jxl.format.Alignment.CENTRE);//水平居中 + wcf.setVerticalAlignment(VerticalAlignment.CENTRE);//垂直居中 ws.setRowView(0, 300); // 设置指定行高 // 设置列宽 for (int j = 0; j < 15; j++) @@ -747,11 +748,12 @@ public class ExcelUtil WritableFont wf = new WritableFont(WritableFont.ARIAL, 12, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK); WritableCellFormat wcf = new WritableCellFormat(wf); wcf.setAlignment(jxl.format.Alignment.CENTRE);//水平居中 + wcf.setVerticalAlignment(VerticalAlignment.CENTRE);//垂直居中 ws.setRowView(0, 300); // 设置指定行高 // 设置列宽 for (int j = 0; j < 31; j++) { - ws.setColumnView(j, 15); + ws.setColumnView(j, 7); } //创建Excel标题格式 ws.mergeCells(0, 0, 0, 3); @@ -763,7 +765,7 @@ public class ExcelUtil ws.mergeCells(2, 1, 2, 3); ws.addCell(new Label(2, 1, "女", wcf)); ws.mergeCells(3, 0, 4, 0); - ws.addCell(new Label(0, 0, "婚前医学检查人数", wcf)); + ws.addCell(new Label(3, 0, "婚前医学检查人数", wcf)); ws.mergeCells(3, 1, 3, 3); ws.addCell(new Label(3, 1, "男", wcf)); ws.mergeCells(4, 1, 4, 3); -- 1.8.3.1