I AM WORKING ON A LIVE PROJECT -- needs to be delivered soon ---Kindly help !!!!
I don't have time to write some complex excel code so I wrote my own basic code to extract data which works good but I should also be able to read
numeric values form the excel sheet
right now I am just using c.getStringCellValue();
I think I have some numeric values in my test data sheet and the excel code that I am using is not reading values form a number cell(Please check the image
@DataProvider(name="negativeRegistration")
public Object[][] negregistrationdata() throws Throwable
{
{
InputStream f = new FileInputStream(CONFIG.getProperty("DataSheet1_Path"));
Workbook wb = WorkbookFactory.create(f);
Sheet s =wb.getSheet("NRegData");
int rowcount = s.getLastRowNum();
r = s.getRow(0);
int cellno = r.getLastCellNum();
//System.out.println(rowcount);
Object data [][] = new Object[rowcount][cellno];
for (int i = 1; i<=rowcount;i++)
{
Row r = s.getRow(i);
for(int j= 0;j<cellno;j++)
{
Cell c = r.getCell(j);
data[i-1][j] = c.getStringCellValue();
}
}
return data;
}
}