We help IT Professionals succeed at work.
Get Started

Problem with Poi ForumulaRecord.getValue()

allelopath
allelopath asked
on
457 Views
Last Modified: 2012-05-12
We have a problem with ForumulaRecord.getValue() returning a 0 value when we know there should be a valid value. The problem appears to be somehow related to a "corruption" in the excel file. If we have the problem and then we save the file or open & repair the file, the problem does not occur (ie getValue() returns the expected value).

The formula is something like: =f4+g4+h4+i4

Any ideas about what is going wrong or what to do?

In our class that implements HSSFListener, we have:
	public void processRecord(Record record) {

		int row = 0;
		int column = 0;

		HSSFRow hssfRow = null;
		HSSFCell hssfCell = null;

		switch (record.getSid()) {
...
		case FormulaRecord.sid:

			FormulaRecord formulaRecord = (FormulaRecord) record;
			row = formulaRecord.getRow();
			column = formulaRecord.getColumn();
			// =f4+g4+h4+i4
			double doubleValue = formulaRecord.getValue(); // sometimes unexpectedly 0
...
}

Open in new window

                 
Comment
Watch Question
Awarded 2011
Awarded 2011
Commented:
This problem has been solved!
Unlock 1 Answer and 18 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE