Commit 4f88b23e82ec32e5af3bf1707319e9b6546fc590
1 parent
56dcfbcf9e
Exists in
master
and in
8 other branches
code update
Showing 1 changed file with 29 additions and 12 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java
View file @
4f88b23
... | ... | @@ -41,32 +41,49 @@ |
41 | 41 | { |
42 | 42 | wwb = Workbook.createWorkbook(out); |
43 | 43 | WritableSheet ws = wwb.createSheet("sheet", 0); // 创建一个工作表 |
44 | + // 设置指定行高 | |
45 | + ws.setRowView(0, 300); | |
44 | 46 | /** |
45 | 47 | * 设置单元格样式 |
46 | 48 | */ |
47 | 49 | WritableFont wf = new WritableFont(WritableFont.ARIAL, 12, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK); |
48 | 50 | WritableCellFormat wcf = new WritableCellFormat(wf); |
49 | - // 设置指定行高 | |
50 | - ws.setRowView(0, 300); | |
51 | + wcf.setAlignment(jxl.format.Alignment.CENTRE); | |
51 | 52 | |
53 | + WritableFont font1 = new WritableFont(WritableFont.ARIAL, 8, WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK); | |
54 | + WritableCellFormat title1 = new WritableCellFormat(font1); | |
55 | + title1.setAlignment(jxl.format.Alignment.CENTRE); | |
52 | 56 | |
57 | + | |
53 | 58 | // 设置列宽 |
54 | 59 | for (int j = 0, columLen = columName.size(); j < columLen; j++) |
55 | 60 | { |
56 | 61 | ws.setColumnView(j, 15); |
57 | 62 | } |
58 | 63 | |
59 | - ws.addCell(new Label(0, 0, "aaaa", wcf)); | |
60 | - ws.addCell(new Label(1, 0, "aaaa", wcf)); | |
61 | - ws.addCell(new Label(2, 0, "aaaa", wcf)); | |
62 | - ws.addCell(new Label(3, 0, "aaaa", wcf)); | |
63 | - ws.addCell(new Label(4, 0, "aaaa", wcf)); | |
64 | - ws.addCell(new Label(5, 0, "标题", wcf)); | |
65 | - ws.addCell(new Label(13, 0, "asdfasdf", wcf)); | |
66 | - ws.addCell(new Label(14, 0, "bbbb", wcf)); | |
67 | - | |
68 | - | |
64 | + ws.addCell(new Label(0, 0, "姓名", wcf)); | |
65 | + ws.addCell(new Label(1, 0, "当前年龄", wcf)); | |
66 | + ws.addCell(new Label(2, 0, "当前孕周", wcf)); | |
67 | + ws.addCell(new Label(3, 0, "联系方式", wcf)); | |
68 | + ws.addCell(new Label(4, 0, "处理意见", wcf)); | |
69 | + ws.addCell(new Label(5, 0, "姓名", wcf)); | |
70 | + ws.addCell(new Label(13, 0, "预约产检日期", wcf)); | |
71 | + ws.addCell(new Label(14, 0, "本院产检次数", wcf)); | |
72 | + ws.addCell(new Label(15, 0, "产检医生", wcf)); | |
73 | + ws.addCell(new Label(16, 0, "登记人", wcf)); | |
74 | + ws.addCell(new Label(17, 0, "服务类型", wcf)); | |
75 | + ws.addCell(new Label(18, 0, "高危因素", wcf)); | |
76 | + ws.addCell(new Label(19, 0, "高危等级", wcf)); | |
77 | + ws.addCell(new Label(20, 0, "预产期", wcf)); | |
69 | 78 | ws.mergeCells(5, 0, 12, 0); |
79 | + | |
80 | + ws.addCell(new Label(6, 1, "乙肝表面抗体", title1)); | |
81 | + ws.addCell(new Label(7, 1, "乙肝e抗原", title1)); | |
82 | + ws.addCell(new Label(8, 1, "乙肝e抗体", title1)); | |
83 | + ws.addCell(new Label(9, 1, "乙肝核心抗体", title1)); | |
84 | + ws.addCell(new Label(10, 1, "梅毒", title1)); | |
85 | + ws.addCell(new Label(11, 1, "HIV", title1)); | |
86 | + ws.addCell(new Label(12, 1, "丙肝", title1)); | |
70 | 87 | |
71 | 88 | // // 填充数据的内容 |
72 | 89 | // Map<String, Object> map; |