I need to find the point in the POI code where a formula is read in from an
excel cell. Can someone point me to this?

I'm having a problem with POI with the a formula value not being calculated
(always getting 0 in FormulaRecord.getValue()). So presumably it first has
to read the formula before it can calculate it, but it is difficult to find
this without knowing the internal structure of excel files.

The class extends HSSFListener and so has:
      public void processRecord(Record record) ...

and the record at that point has 0 when it should have a calculated number.

Looking in RecordFactoryInputStream.nextRecord() and adding a debug
statement, it appears that the number is already calculated:

*record = readNextRecord();
if (record instanceof FormulaRecord) {
        System.out.println ("RecordFactoryInputStream.nextRecord(); " +
record.toString());
}*

Toggle HighlightingOpen in New WindowSelect All

RecordFactoryInputStream.nextRecord(); [FORMULA]
    .row    = 0x0003
    .col    = 0x0002
    .xfindex= 0x0040
  .value       = -0.1609487366724528
  .options   = 0x0008
    .alwaysCalc= false
    .calcOnLoad= false
    .shared    = true
  .zero      = 0xFE090003
    Ptg[0]=[Array Formula or Shared Formula]
row = 3
col = 2
.
[/FORMULA]

The output data above is a case where the formula is calculated correctly.

Using 3.8 beta3. 

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Where-is-POI-formula-read-for-HSSF-tp4967675p4967675.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to