You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by milan777 <mi...@gmail.com> on 2013/06/06 08:56:04 UTC

Please let me help to solve the error........

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: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org