Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 0a38b107381e947533adbb55ab5f647c > files > 57

jakarta-poi-manual-3.1-0.0.2mdv2010.0.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--*** This is a generated file.  Do not edit.  ***-->
<link rel="stylesheet" href="../skin/tigris.css" type="text/css">
<link rel="stylesheet" href="../skin/mysite.css" type="text/css">
<link rel="stylesheet" href="../skin/site.css" type="text/css">
<link media="print" rel="stylesheet" href="../skin/print.css" type="text/css">
<title>Formula Support</title>
</head>
<body bgcolor="white" class="composite">
<!--================= start Banner ==================-->
<div id="banner">
<table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0">
<tbody>
<tr>
<!--================= start Group Logo ==================-->
<td align="left">
<div class="groupLogo">
<a href="http://poi.apache.org"><img border="0" class="logoImage" alt="Apache POI" src="../resources/images/group-logo.jpg"></a>
</div>
</td>
<!--================= end Group Logo ==================-->
<!--================= start Project Logo ==================--><td align="right">
<div class="projectLogo">
<a href="http://poi.apache.org/"><img border="0" class="logoImage" alt="POI" src="../resources/images/project-logo.jpg"></a>
</div>
</td>
<!--================= end Project Logo ==================-->
</tr>
</tbody>
</table>
</div>
<!--================= end Banner ==================-->
<!--================= start Main ==================-->
<table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs">
<tbody>
<!--================= start Status ==================-->
<tr class="status">
<td>
<!--================= start BreadCrumb ==================--><a href="http://www.apache.org/">Apache</a> | <a href="http://poi.apache.org/">POI</a><a href=""></a>
<!--================= end BreadCrumb ==================--></td><td id="tabs">
<!--================= start Tabs ==================-->
<div class="tab">
<span class="selectedTab"><a class="base-selected" href="../index.html">Home</a></span> | <script language="Javascript" type="text/javascript">
function printit() {  
if (window.print) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
}
}
</script><script language="Javascript" type="text/javascript">
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
    document.write('  <a title="PRINT this page OUT" href="javascript:printit()">PRINT</a>');
}
</script> | <a title="PDF file of this page" href="formula.pdf">PDF</a>
</div>
<!--================= end Tabs ==================-->
</td>
</tr>
</tbody>
</table>
<!--================= end Status ==================-->
<table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0">
<tbody>
<tr valign="top">
<!--================= start Menu ==================-->
<td id="leftcol">
<div id="navcolumn">
<div class="menuBar">
<div class="menu">
<span class="menuLabel">Apache POI</span>
        
<div class="menuItem">
<a href="../index.html">Top</a>
</div>
    
</div>
<div class="menu">
<span class="menuLabel">HSSF</span>
        
<div class="menuItem">
<a href="index.html">Overview</a>
</div>
        
<div class="menuItem">
<a href="quick-guide.html">Quick Guide</a>
</div>
        
<div class="menuItem">
<a href="how-to.html">HOWTO</a>
</div>
        
<div class="menuItem">
<span class="menuSelected">Formula Support</span>
</div>
        
<div class="menuItem">
<a href="eval.html">Formula Evaluation</a>
</div>
		
<div class="menuItem">
<a href="eval-devguide.html">Eval Dev Guide</a>
</div>
        
<div class="menuItem">
<a href="use-case.html">Use Case</a>
</div>
        
<div class="menuItem">
<a href="diagrams.html">Pictorial Docs</a>
</div>
        
<div class="menuItem">
<a href="limitations.html">Limitations</a>
</div>
    
</div>
<div class="menu">
<span class="menuLabel">Contributer's Guide</span>
        
<div class="menuItem">
<a href="hacking-hssf.html">Hacking HSSF</a>
</div>
        
<div class="menuItem">
<a href="record-generator.html">Record Generator</a>
</div>
        
<div class="menuItem">
<a href="chart.html">Charts</a>
</div>
    
</div>
</div>
</div>
<form target="_blank" action="http://www.google.com/search" method="get">
<table summary="search" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"><input value="poi.apache.org" name="sitesearch" type="hidden"><input size="10" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../skin/images/spacer.gif" class="spacer"><input name="Search" value="GO" type="submit">
<br>
                          Search poi</td><td><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td>
</tr>
<tr>
<td colspan="3"><img height="7" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td>
</tr>
<tr>
<td class="bottom-left-thick"></td><td bgcolor="#a5b6c6"><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td><td class="bottom-right-thick"></td>
</tr>
</table>
</form>
</td>
<!--================= end Menu ==================-->
<!--================= start Content ==================--><td>
<div id="bodycol">
<div class="app">
<div align="center">
<h1>Formula Support</h1>
</div>
<div class="h3">
    
    
        
<div class="h3">
<h3>Introduction</h3>
</div>
            
<p>
                This document describes the current state of formula support in POI. 
                The information in this document currently applies to the 2.0 version of POI. 
                Since this area is a work in progress, this document will be updated with new features as and 
                when they are added. 
            </p>
           
        
        
<div class="h3">
<h3>The basics</h3>
</div>
              
<p>
                In org.apache.poi.hssf.usermodel.HSSFCell
                    <strong> setCellFormula("formulaString") </strong> is used to add a formula to sheet and 
                    <strong> getCellFormula() </strong> is used to retrieve the string representation of a formula. 
                </p>
            
<p>
                We aim to support the complete excel grammer for formulas. Thus, the string that you pass in 
                to the <em> setCellFormula </em> call should be what you expect to type into excel. Also, note
                that you should NOT add a "=" to the front of the string.  
            </p>
        
        
<div class="h3">
<h3>Supported Features</h3>
</div>
        
<ul>
             
<li>Cell References</li>
             
<li>String, integer and floating point literals</li>
              
<li>Area references</li>
              
<li>Relative or absolute references</li>
              
<li>Arithmetic and logical operators</li>
              
<li>Sheet or Macro Functions (inlcuding logical functions)</li>
              
<li>Sheet References</li>
              
<li>Formual return values (number or string)</li>
        
</ul>
        
        
<div class="h3">
<h3>Partially supported</h3>
</div>
            
<ul>
                
<li>Formula tokens in Excel are stored in one of three possible <em> classes </em>:
                    Reference, Value and Array. Based on the location of a token, its class can change
                    in complicated and undocumented ways. While we have support for most cases, we
                    are not sure if we have covered all bases (since there is no documentation for this area.)
                    We would therefore like you to report any
                    occurence of #VALUE! in a cell upon opening a POI generated workbook in excel. (Check that
                    typing the formula into Excel directly gives a valid result.)
            </li>
                    
            
</ul>
        
        
<div class="h3">
<h3>Not yet supported</h3>
</div>
            
<ul>
                
<li>Array formulas</li>
                
<li>Unary Operators</li>
                
<li>3D References</li>
                
<li>Error Values (cells containing #REF's or #VALUE's)</li>
                
<li>Everything else :) </li>
            
</ul>
        

        
<div class="h3">
<h3>Internals</h3>
</div>
            
<p>
                Formulas in Excel are stored as  sequences of tokens in Reverse Polish Notation order. The 
                <a href="http://sc.openoffice.org/excelfileformat.pdf">open office XLS spec</a> is the best
                documentation you will find for the format.
            </p>

            
<p>
                The tokens used by excel are modelled as individual *Ptg classes in the <strong>
                org.apache.poi.hssf.record.formula</strong> package. 
            </p>
            
<p>
                The task of parsing a formula string into an array of RPN ordered tokens is done by the <strong>
                org.apache.poi.hssf.record.formula.FormulaParser</strong> class. This class implements a hand 
                written recursive descent parser. 
            </p>
            
<p>Check out the <a href="http://poi.apache.org/javadocs/">javadocs </a> for details. 
            </p>
        
       
    

<div id="authors" align="right">by&nbsp;Avik Sengupta</div>
</div>
</div>
</div>
</td>
<!--================= end Content ==================-->
</tr>
</tbody>
</table>
<!--================= end Main ==================-->
<!--================= start Footer ==================-->
<div id="footer">
<table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0">
<tbody>
<tr>
<!--================= start Copyright ==================-->
<td colspan="2">
<div align="center">
<div class="copyright">
              Copyright &copy; 2002-2007&nbsp;The Apache Software Foundation. All rights reserved.
            </div>
</div>
</td>
<!--================= end Copyright ==================-->
</tr>
<tr>
<td align="left">
<!--================= start Host ==================-->
<!--================= end Host ==================--></td><td align="right">
<!--================= start Credits ==================-->
<div align="right">
<div class="credit"></div>
</div>
<!--================= end Credits ==================-->
</td>
</tr>
</tbody>
</table>
</div>
<!--================= end Footer ==================-->
</body>
</html>