poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saravanan P <saravanan....@gmail.com>
Subject Re: How to get the Excel WorkBook operators using apache poi 3.6?
Date Tue, 07 Dec 2010 05:49:58 GMT
*thanks for your reply.but how to write generic code for supporting both
.xls and .xlsx files.... Please give me an idea...


**Thanks & Regards,

Saravanan.P
**
***************************************************************************************
Never Design your life like GARDEN, any one can walk...!
So, Design your life like SKY where every one has aspire to reach...!
***************************************************************************************
*



On Mon, Dec 6, 2010 at 6:40 PM, Yegor Kozlov <yegor@dinom.ru> wrote:

> A formula in Excel consists of indivisible particles called tokens. In the
> BIFF8 terminology tokens are called PTGs (for Parsed Thing). In the .xls
> format the tokens are stored in the Reverse-Polish Notation (RPN). If you
> dont know what RPN tokens are, read this
> http://www-stone.ch.cam.ac.uk/documentation/rrf/rpn.html.
>
> The simple term 1+2 consists of the 3 tokens “1”, “+” and “2”. Written in
> RPN, the formula is converted to the token list “1”, “2”, “+”.
>
> To get the formula tokens you can use the HSSFFormulaParser and
> XSSFFormulaParser classes.
>
> Here is a sample code:
>
> Ptg[] ptg = HSSFFormulaParser.parse("1+2", workbook);
>
> The returned Ptg array consists of three elements:
>
> IntPtg (value=1)
> IntPtg (value=2)
> AddPtg (operator)
>
> To get the list of formula operators in a workbook you need to iterate over
> the formula cells, parse each formula as shown above and analyze the parsed
> tokens.
>
> A good overview of Excel Formulas is here:
>
> http://people.apache.org/~yegor/apachecon_us2010/Evaluation_Of_Excel_Formulas_In_POI.pptx<http://people.apache.org/%7Eyegor/apachecon_us2010/Evaluation_Of_Excel_Formulas_In_POI.pptx>
>
> Regards,
> Yegor
>
>
>
>
>
>  *Hi All,
>>
>>
>>
>>             I want to get all the excel workbook mathematical operators
>> using apache poi 3.6 through programatically.
>>
>> How do i get it?
>>
>> Please help me to get an !dea....
>>
>> Expecting your reply...*
>> *
>>
>> **Thanks&  Regards,
>>
>> Saravanan.P
>> *
>> *
>>
>> ***************************************************************************************
>> Never Design your life like GARDEN, any one can walk...!
>> So, Design your life like SKY where every one has aspire to reach...!
>>
>> ***************************************************************************************
>> *
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message