Bael 623 v2 (#1119)

* helper classes for excel processing, tests

* fix imports

* list declaration

* shorten examples, add excel files
This commit is contained in:
lor6 2017-02-07 01:03:00 +02:00 committed by KevinGilmore
parent c198a96ec5
commit 47889bc227
7 changed files with 1 additions and 37 deletions

View File

@ -37,16 +37,6 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.jxls</groupId>

View File

@ -62,12 +62,7 @@ public class JExcelHelper {
sheet.addCell(cellLabel);
Number cellNumber = new Number(1, 2, 20, cellFormat);
sheet.addCell(cellNumber);
cellLabel = new Label(0, 3, "Ana Johnson", cellFormat);
sheet.addCell(cellLabel);
cellNumber = new Number(1, 3, 30, cellFormat);
sheet.addCell(cellNumber);
workbook.write();
} finally {
if (workbook != null) {

View File

@ -110,15 +110,6 @@ public class ExcelPOIHelper {
cell.setCellValue(20);
cell.setCellStyle(style);
row = sheet.createRow(3);
cell = row.createCell(0);
cell.setCellValue("Ana Johnson");
cell.setCellStyle(style);
cell = row.createCell(1);
cell.setCellValue(30);
cell.setCellStyle(style);
File currDir = new File(".");
String path = currDir.getAbsolutePath();
String fileLocation = path.substring(0, path.length() - 1) + "temp.xlsx";

View File

@ -51,12 +51,6 @@ public class JExcelTest {
.get(0));
assertEquals("20", data.get(2)
.get(1));
assertEquals("Ana Johnson", data.get(3)
.get(0));
assertEquals("30", data.get(3)
.get(1));
}
}

View File

@ -48,12 +48,6 @@ public class ExcelTest {
.get(0));
assertEquals("20", data.get(1)
.get(1));
assertEquals("Ana Johnson", data.get(2)
.get(0));
assertEquals("30", data.get(2)
.get(1));
}
}

BIN
apache-poi/temp.xls Normal file

Binary file not shown.

BIN
apache-poi/temp.xlsx Normal file

Binary file not shown.