Unable to Retrieve the values from excel sheet properly
venkateshhvp opened this issue · 3 comments
Hi @ozlerhakan ,
I implemented the same way as you mentioned in the documentation, but I m not able to get the values properly.
Instead of the excel values, I m getting only the instance like this [ExcelPoijiDemo@71ae31b0, ExcelPoijiDemo@4ba534b0]
Main.java
List demo = Poiji.fromExcel(new File("inputdata.xlsx"), ExcelPoijiDemo.class);
System.out.println(demo);
ExcelPoijiDemo.java
@excelsheet("Sheet1")
public class ExcelPoijiDemo {
@ExcelCellName("name")
private String name;
@ExcelCellName("department")
private String department;
}
Thank you for contributing to Poiji! Feel free to create a PR If you want to contribute directly :)
Hi @venkateshhvp ,
This is the way how we can retrieve rows from an excel file:
PoijiOptions options = PoijiOptions.PoijiOptionsBuilder.settings()
.addListDelimiter(";") (1)
.build();
List<Employee> employees = Poiji.fromExcel(new File("employees.xls"), Employee.class, options);
// alternatively
InputStream stream = new FileInputStream(new File("employees.xls"))
List<Employee> employees = Poiji.fromExcel(stream, PoijiExcelType.XLS, Employee.class, options);
employees.size();
// 3
Employee firstEmployee = employees.get(0);
// Employee{rowIndex=1, employeeId=123923, name='Joe', surname='Doe', age=30, single=true, emails=[joe@doe.com, joedoe@gmail.com], biils=[123,10, 99.99]}
Hi @ozlerhakan,my output is different than what you showed. Please check and confirm if anything is wrong from my side.
I tried giving (1) as attached, but not sure what it was meaning and got syntax error.