Generic way of reading Excel file using Apache POI

Generic way of reading Excel file using Apache POI is a way of reading excel file in a dynamic configurable way to read an excel file where in future if you add more columns or remove columns from excel then you don’t need to almost touch the Java source code but you change the configurations that makes your life easier. Here we will see how we can define configurations in JSON file and read the excel file using Apache POI to establish mapping between JSON and Java POJO.

We have also seen Generic way of Excel file writing using Apache POI.

Obviously whenever you want to read or write to excel file you need to use Java Reflection API though it is not recommended to use Java Reflection API but in rare situations you may need to use Reflection.

You may also like to read:

Instantiate object from a class which contains private constructor

Read excel file using Python

The Apache POI is to create and maintain Java APIs for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft’s OLE 2 Compound Document format (OLE2). You can read and write MS Excel files using Java. In addition, you can read and write MS Word and MS PowerPoint files using Java. Apache POI is the Java Excel solution (for Excel 97-2008).

Continue reading “Generic way of reading Excel file using Apache POI”

Deal with empty or blank cell in excel file using apache poi

This tutorial will show you how we can deal with empty or blank cell in excel file using Apache POI. We cannot handle blank or empty cell if we use cell iterator, so we have to get the maximum cell index for the row and iterate through index to deal with empty cell.

The Apache POI is to create and maintain Java APIs for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft’s OLE 2 Compound Document format (OLE2). You can read and write MS Excel files using Java. In addition, you can read and write MS Word and MS PowerPoint files using Java. Apache POI is the Java Excel solution (for Excel 97-2008).

For more information please go through https://poi.apache.org/

If you already have an idea on how to create a maven project in Eclipse will be great otherwise I will tell you here how to create a maven project in Eclipse. Continue reading “Deal with empty or blank cell in excel file using apache poi”