how to upload excel result set into pagelist using Apache POI
i have a Scenario to upload excel file result into page list using Apache POI, but code is not working.could you please help me to sort this out.Here attached with screenshot .iss
this is the Java code
i have a Scenario to upload excel file result into page list using Apache POI, but code is not working.could you please help me to sort this out.Here attached with screenshot .iss
this is the Java code
try{
java.io.InputStream myxls = new java.io.FileInputStream(FileName);
org.apache.poi.hssf.usermodel.HSSFWorkbook wb = new org.apache.poi.hssf.usermodel.HSSFWorkbook(myxls);
org.apache.poi.hssf.usermodel.HSSFSheet sheet = wb.getSheetAt(0);
for (int j=0; j< sheet.getLastRowNum() + 1; j++) {
org.apache.poi.hssf.usermodel.HSSFRow row = sheet.getRow(j);
org.apache.poi.hssf.usermodel.HSSFCell cell1 = row.getCell(0);
String a=cell1.getStringCellValue();
org.apache.poi.hssf.usermodel.HSSFCell cell2 = row.getCell(1);
String b=cell2.getStringCellValue();
org.apache.poi.hssf.usermodel.HSSFCell cell3 = row.getCell(2);
String c=cell3.getStringCellValue();
ClipboardProperty class1= tools.findPageWithException("VehicleModels").getProperty(".pxResults(<append>).pxObjClass");
class1.setValue("CTC-Data-VehicleModel");
ClipboardProperty Brand= tools.findPageWithException("VehicleModels").getProperty(".pxResults(<last>).Brand");
Brand.setValue(a);
ClipboardProperty VehicleType= tools.findPageWithException("VehicleModels").getProperty(".pxResults(<last>).VehicleType");
VehicleType.setValue(b);
ClipboardProperty Model= tools.findPageWithException("VehicleModels").getProperty(".pxResults(<last>).Model");
Model.setValue(c);
}
}
catch(Exception x)
{
}