Bug 26502

Summary: [PATCH] Conversion of Shared Formula to individual Formula
Product: POI Reporter: Jason Height <jheight>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: org\apache\poi\hssf\record\formula\AreaAPtg.java
org\apache\poi\hssf\record\formula\AreaNAPtg.java
org\apache\poi\hssf\record\formula\AreaNPtg.java
org\apache\poi\hssf\record\formula\AreaNVPtg.java
org\apache\poi\hssf\record\formula\AreaVPtg.java
org\apache\poi\hssf\record\formula\RefAPtg.java
org\apache\poi\hssf\record\formula\RefNAPtg.java
org\apache\poi\hssf\record\formula\RefNPtg.java
org\apache\poi\hssf\record\formula\RefNVPtg.java
org\apache\poi\hssf\record\formula\RefVPtg.java
The shared formula patch to existing files.
getCellFormula() returns NO IDEA SHARED FORMULA EXP PTG

Description Jason Height 2004-01-28 21:29:00 UTC
Please find attached a patch that i had done some time ago. This was done
against the HEAD.

Avik, I havent tried to apply it against HEAD recently, but hopefully it is ok.
Comment 1 Jason Height 2004-01-28 21:30:58 UTC
Created attachment 10121 [details]
org\apache\poi\hssf\record\formula\AreaAPtg.java
Comment 2 Jason Height 2004-01-28 21:31:25 UTC
Created attachment 10122 [details]
org\apache\poi\hssf\record\formula\AreaNAPtg.java
Comment 3 Jason Height 2004-01-28 21:31:46 UTC
Created attachment 10123 [details]
org\apache\poi\hssf\record\formula\AreaNPtg.java
Comment 4 Jason Height 2004-01-28 21:32:09 UTC
Created attachment 10124 [details]
org\apache\poi\hssf\record\formula\AreaNVPtg.java
Comment 5 Jason Height 2004-01-28 21:32:32 UTC
Created attachment 10125 [details]
org\apache\poi\hssf\record\formula\AreaVPtg.java
Comment 6 Jason Height 2004-01-28 21:34:18 UTC
Created attachment 10126 [details]
org\apache\poi\hssf\record\formula\RefAPtg.java
Comment 7 Jason Height 2004-01-28 21:34:38 UTC
Created attachment 10127 [details]
org\apache\poi\hssf\record\formula\RefNAPtg.java
Comment 8 Jason Height 2004-01-28 21:34:58 UTC
Created attachment 10128 [details]
org\apache\poi\hssf\record\formula\RefNPtg.java
Comment 9 Jason Height 2004-01-28 21:35:23 UTC
Created attachment 10129 [details]
org\apache\poi\hssf\record\formula\RefNVPtg.java
Comment 10 Jason Height 2004-01-28 21:35:41 UTC
Created attachment 10130 [details]
org\apache\poi\hssf\record\formula\RefVPtg.java
Comment 11 Jason Height 2004-01-28 21:36:45 UTC
Created attachment 10131 [details]
The shared formula patch to existing files.
Comment 12 Jason Height 2004-01-28 21:38:00 UTC
I found my patch file that only contained the shared formula stuff. Have a look
at it and see how it goes. Sorry that i dont have the time to apply it myself

Jason
Comment 13 Ulrich Bode 2004-07-16 13:43:49 UTC
Patch does not work.

1. Add this Method to FormulaRecord (missed)
    public void setParsedExpression(List newParsedExpression)
    {
      field_8_parsed_expr = (Stack) newParsedExpression;  
    }
2. method construct defect
The method "construct" in class ValueRecordsAggregate throws 
a "RuntimeException "Shared formula bit set but next record not Shared 
Formula??"
or the FormulaRecord formula could be null.

mail@ulrich-bode.de
Comment 14 Avik Sengupta 2004-07-16 13:58:05 UTC
Can you provide an xl file that bombs? Reopening, since even if the patch is not
complete, we still have the issue and need to fix it. 
Comment 15 vanishree narasimhan 2005-06-07 20:14:52 UTC
Created attachment 15328 [details]
getCellFormula()  returns NO IDEA SHARED FORMULA EXP PTG


   The last column is a formula column in my attached excel sheet ,it is not
being read by POI.
    System.out.println("srcCell.getCellFormula() ="+srcCell.getCellFormula());
	returns "NO IDEA SHARED FORMULA EXP PTG"
	
It fails in HSSFFormulaEvaluator at the following code block

	 FormulaParser parser = new FormulaParser(srcCell.getCellFormula(),
workbook.getWorkbook());
	 parser.parse(); //as parser expected an excel formula rather than a
String
	
Can anyone help me read the formula cell's value.

Thanks
regards
Vani.
Comment 16 Bernhard Gruber 2006-05-23 13:25:09 UTC
Anybody still working on this? It seems to be the same problem in bugIds #20321 
and #36941. When will shared formuals be supported?
Comment 17 Jason Height 2006-07-25 14:28:35 UTC
Implemented in SVN. Works OK.
Comment 18 C. A. Caillibot 2006-11-07 07:20:54 UTC
(In reply to comment #17)

Should it be working in POI 3.0 alpha2?