import java.io.IOException;

import jxl.CellType;
import jxl.Cell;
import jxl.Sheet;

import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class CreateNewWorkBook {

public static void main(String args[]) throws IOException
{
XSSFWorkbook wb = new XSSFWorkbook();
   
   Sheet sheet = (Sheet) wb.getSheet("d:/test.xlsx"); 

 try{
         for (int i = 0; i < sheet.getRows(); i++) {
 
                System.out.println("");
                for (int j = 0; j < sheet.getColumns(); j++) {

                        Cell cell = sheet.getCell(j, i);
                        CellType type = cell.getType();
                        if (type == CellType.LABEL) {
                                System.out.print("\t lable "
                                                + cell.getContents().trim());
                        }

                        if (type == CellType.NUMBER) {
                        System.out.print("\t number " +
                        cell.getContents().trim()); }
                         

                }
        }
 } catch(Exception e){
         e.printStackTrace();
 }
 
}
}

getting error like nullpointer exception :( :(



--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Getting-error-while-reading-xlsx-file-in-using-poi-tp5712947p5712948.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to