From 467589c2f0655584b78c9e5c045da1a35046a423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Thu, 20 Apr 2023 10:57:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/UnitTest/TestRegex.java | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/FengHuang/src/main/java/UnitTest/TestRegex.java b/FengHuang/src/main/java/UnitTest/TestRegex.java index 487f20a..5227af0 100644 --- a/FengHuang/src/main/java/UnitTest/TestRegex.java +++ b/FengHuang/src/main/java/UnitTest/TestRegex.java @@ -48,8 +48,6 @@ public class TestRegex { public static void ExportExcel(List list, List errlist) throws IOException { XSSFWorkbook xssfWorkbook = new XSSFWorkbook(new FileInputStream(path)); XSSFSheet sheet1 = xssfWorkbook.getSheetAt(0); - - //正文与表头不是一个颜色 XSSFFont txtFont = xssfWorkbook.createFont(); txtFont.setFontHeightInPoints((short) 11); //字体大小 txtFont.setFontName("等线"); //字体 @@ -86,31 +84,31 @@ public class TestRegex { //调整宽度 sheet1.setColumnWidth(14, 512 * 50 + 184); - //填充 - for (int i = 0; i < list.size(); i++) { - Record record = list.get(i); - int id = record.getInt("id"); - String zhuanye = record.getStr("zhuanye"); - String xf = record.getStr("xf"); - String memo = record.getStr("memo"); - try { - row = sheet1.getRow(id + 1); - cell = row.createCell(12); - cell.setCellValue(zhuanye); - cell.setCellStyle(cellStyleTxt); - - cell = row.createCell(13); - cell.setCellValue(xf); - cell.setCellStyle(cellStyleTxt); - - cell = row.createCell(14); - cell.setCellValue(memo); - cell.setCellStyle(cellStyleTxt); - } catch (Exception err) { - System.out.println(err.toString()); - } - - } +// //填充 +// for (int i = 0; i < list.size(); i++) { +// Record record = list.get(i); +// int id = record.getInt("id"); +// String zhuanye = record.getStr("zhuanye"); +// String xf = record.getStr("xf"); +// String memo = record.getStr("memo"); +// try { +// row = sheet1.getRow(id + 1); +// cell = row.createCell(12); +// cell.setCellValue(zhuanye); +// cell.setCellStyle(cellStyleTxt); +// +// cell = row.createCell(13); +// cell.setCellValue(xf); +// cell.setCellStyle(cellStyleTxt); +// +// cell = row.createCell(14); +// cell.setCellValue(memo); +// cell.setCellStyle(cellStyleTxt); +// } catch (Exception err) { +// System.out.println(err.toString()); +// } + + // } // //写入异常数据 // XSSFSheet sheet2 = xssfWorkbook.getSheetAt(1); // for (int i = 0; i < errlist.size(); i++) {