diff --git a/apache-poi/pom.xml b/apache-poi/pom.xml index 1b97248ab2..d8a2cc72e0 100644 --- a/apache-poi/pom.xml +++ b/apache-poi/pom.xml @@ -37,16 +37,6 @@ org.apache.poi poi-ooxml ${poi.version} - - - org.apache.poi - poi - ${poi.version} - - - org.apache.poi - poi-ooxml-schemas - ${poi.version} org.jxls diff --git a/apache-poi/src/main/java/com/baeldung/jexcel/JExcelHelper.java b/apache-poi/src/main/java/com/baeldung/jexcel/JExcelHelper.java index 39076fd709..4ad3fc766c 100644 --- a/apache-poi/src/main/java/com/baeldung/jexcel/JExcelHelper.java +++ b/apache-poi/src/main/java/com/baeldung/jexcel/JExcelHelper.java @@ -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) { diff --git a/apache-poi/src/main/java/com/baeldung/poi/excel/ExcelPOIHelper.java b/apache-poi/src/main/java/com/baeldung/poi/excel/ExcelPOIHelper.java index 841be22d62..b6b0cbef20 100644 --- a/apache-poi/src/main/java/com/baeldung/poi/excel/ExcelPOIHelper.java +++ b/apache-poi/src/main/java/com/baeldung/poi/excel/ExcelPOIHelper.java @@ -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"; diff --git a/apache-poi/src/test/java/com/baeldung/jexcel/JExcelTest.java b/apache-poi/src/test/java/com/baeldung/jexcel/JExcelTest.java index f0c129eb22..8ee465be34 100644 --- a/apache-poi/src/test/java/com/baeldung/jexcel/JExcelTest.java +++ b/apache-poi/src/test/java/com/baeldung/jexcel/JExcelTest.java @@ -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)); - } } \ No newline at end of file diff --git a/apache-poi/src/test/java/com/baeldung/poi/excel/ExcelTest.java b/apache-poi/src/test/java/com/baeldung/poi/excel/ExcelTest.java index f58db241b2..34fa64dd94 100644 --- a/apache-poi/src/test/java/com/baeldung/poi/excel/ExcelTest.java +++ b/apache-poi/src/test/java/com/baeldung/poi/excel/ExcelTest.java @@ -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)); - } } \ No newline at end of file diff --git a/apache-poi/temp.xls b/apache-poi/temp.xls new file mode 100644 index 0000000000..1fad76d88d Binary files /dev/null and b/apache-poi/temp.xls differ diff --git a/apache-poi/temp.xlsx b/apache-poi/temp.xlsx new file mode 100644 index 0000000000..da67ca9e9e Binary files /dev/null and b/apache-poi/temp.xlsx differ