Bael 623 v2 (#1119)
* helper classes for excel processing, tests * fix imports * list declaration * shorten examples, add excel files
This commit is contained in:
parent
c198a96ec5
commit
47889bc227
|
@ -37,16 +37,6 @@
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>${poi.version}</version>
|
<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>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jxls</groupId>
|
<groupId>org.jxls</groupId>
|
||||||
|
|
|
@ -63,11 +63,6 @@ public class JExcelHelper {
|
||||||
Number cellNumber = new Number(1, 2, 20, cellFormat);
|
Number cellNumber = new Number(1, 2, 20, cellFormat);
|
||||||
sheet.addCell(cellNumber);
|
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();
|
workbook.write();
|
||||||
} finally {
|
} finally {
|
||||||
if (workbook != null) {
|
if (workbook != null) {
|
||||||
|
|
|
@ -110,15 +110,6 @@ public class ExcelPOIHelper {
|
||||||
cell.setCellValue(20);
|
cell.setCellValue(20);
|
||||||
cell.setCellStyle(style);
|
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(".");
|
File currDir = new File(".");
|
||||||
String path = currDir.getAbsolutePath();
|
String path = currDir.getAbsolutePath();
|
||||||
String fileLocation = path.substring(0, path.length() - 1) + "temp.xlsx";
|
String fileLocation = path.substring(0, path.length() - 1) + "temp.xlsx";
|
||||||
|
|
|
@ -51,12 +51,6 @@ public class JExcelTest {
|
||||||
.get(0));
|
.get(0));
|
||||||
assertEquals("20", data.get(2)
|
assertEquals("20", data.get(2)
|
||||||
.get(1));
|
.get(1));
|
||||||
|
|
||||||
assertEquals("Ana Johnson", data.get(3)
|
|
||||||
.get(0));
|
|
||||||
assertEquals("30", data.get(3)
|
|
||||||
.get(1));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -48,12 +48,6 @@ public class ExcelTest {
|
||||||
.get(0));
|
.get(0));
|
||||||
assertEquals("20", data.get(1)
|
assertEquals("20", data.get(1)
|
||||||
.get(1));
|
.get(1));
|
||||||
|
|
||||||
assertEquals("Ana Johnson", data.get(2)
|
|
||||||
.get(0));
|
|
||||||
assertEquals("30", data.get(2)
|
|
||||||
.get(1));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue