poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From milan777 <milan79pa...@gmail.com>
Subject Please let me help to solve the error........
Date Thu, 06 Jun 2013 06:56:04 GMT
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


Mime
View raw message