question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to get cell value instead of formula

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ozlerhakancommented, Aug 22, 2020

I have found the way to fix it, this will be in the next version @chaitut715

0reactions
ozlerhakancommented, Oct 10, 2020

up

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Show Value Instead of Formula in Excel (7 Methods)
First, move the cursor to cell C11. · Click Paste on the Clipboard group. · Go to Cell C11 first. · Select Values(V)...
Read more >
Cell linked to text-formatted cell shows formula not value
Select the cell with the formula, press F2, and then press ENTER. The cell displays the value. In the same cell, click Cells...
Read more >
How to Show Formulas in Excel Instead of the Values
Select the cell where you want to show the formula instead of the value. Go to Home –> Find & Select –> Replace...
Read more >
How to Quickly Convert a FORMULA to VALUE in Excel
3. Using Right-Click Menu · First of all, select the range of the cells where you have formulas. · Now, right-click on the...
Read more >
How to quickly convert formulas to values in Excel - Ablebits
Press Shift + F10 and then V to paste only values back to Excel cells. Shift + F10 + V is the shortest...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found