Option to get cell value instead of formula
See original GitHub issueI am getting Cell formula rather than Cell value. Is there any configuration to get Cell value. I saw similar issue #63 but opening new issue as it’s very old. Provided sample code and excel below.
Version: 3.0.0
Java Code: ` import java.io.File; import java.util.List;
import com.poiji.bind.Poiji;
public class PojiPoc {
public static void main(String[] args) {
String filePath ="employees.xls";
List<Employee> employees = Poiji.fromExcel(new File(filePath), Employee.class);
for(Employee emp: employees) {
System.out.println(emp);
}
}
}
public class Employee {
@ExcelRow
private int rowIndex;
@ExcelCell(0)
private long employeeId;
@ExcelCell(1)
private String name;
@ExcelCell(2)
private String surname;
@ExcelCell(3)
private int age;
@ExcelCell(4)
private boolean single;
@ExcelCell(5)
private String birthday;
@ExcelCell(6)
private String age2;
//no need getters/setters to map excel cells to fields
@Override
public String toString() {
return "Employee{" +
"rowIndex=" + rowIndex +
", employeeId=" + employeeId +
", name='" + name + '\'' +
", surname='" + surname + '\'' +
", age=" + age +
", single=" + single +
", birthday='" + birthday + '\'' +
", age2='" + age2 + '\'' +
'}';
}
}`
Input file: employee.xls Output: Employee{rowIndex=1, employeeId=123923, name=‘Joe’, surname=‘Doe’, age=30, single=true, birthday=‘4/9/1987’, age2=‘D22’} Employee{rowIndex=2, employeeId=123123, name=‘Sophie’, surname=‘Derue’, age=20, single=false, birthday=‘5/3/1997’, age2='D32’} Employee{rowIndex=3, employeeId=135923, name=‘Paul’, surname=‘Raul’, age=31, single=false, birthday=‘4/9/1986’, age2=‘D42’} Employee{rowIndex=4, employeeId=135924, name=‘Paul’, surname=‘Raul’, age=31, single=false, birthday=‘4/9/1986’, age2='D52’} Employee{rowIndex=5, employeeId=135925, name=‘Paul’, surname=‘Raul’, age=31, single=false, birthday=‘4/9/1986’, age2=‘D6*2’}
Please let me know if you want to open new issue.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
I have found the way to fix it, this will be in the next version @chaitut715
up