Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > f4a00488d376799785b0ada5da91fdf2 > files > 142

apache-poi-manual-3.8-1.mga2.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 width="50%" 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 width="50%" align="right">
<div align="right" 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+XSSF</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">
<a href="converting.html">HSSF to SS Converting</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="examples.html">Examples</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 class="menuItem">
<a href="user-defined-functions.html">User Defined Functions</a>
</div>
        
<div class="menuItem">
<a href="excelant.html">ExcelAnt Tests</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">
                          Search Apache POI<br>
<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"></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">
    
    
        
<a name="Introduction"></a>
<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 3.5 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>
           
        
        
<a name="The+basics"></a>
<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 grammar 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>
        
        
<a name="Supported+Features"></a>
<div class="h3">
<h3>Supported Features</h3>
</div>
        
<ul>
              
<li>References: single cell &amp; area, 2D &amp; 3D, relative &amp; absolute</li>
              
<li>Literals: Number, text, boolean, error and array</li>
              
<li>Operators: arithmetic and logical, some region operators</li>
              
<li>Built-in functions: over 350 recognised, 280 evaluatable</li>
              
<li>Add-in functions: 3 from Analysis Toolpack</li>
        
</ul>
        
        
<a name="Not+yet+supported"></a>
<div class="h3">
<h3>Not yet supported</h3>
</div>
            
<ul>
                
<li>Manipulating array/table formulas (In Excel, formulas that look like "{=...}" as opposed to "=...")</li>
                
<li>Region operators: union, intersection</li>
                
<li>Parsing of previously uncalled add-in functions</li>
                
<li>Preservation of whitespace in formulas (when POI manipulates them)</li>
            
</ul>
        

        
<a name="Internals"></a>
<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.ss.formula.FormulaParser</strong> class. This class implements a hand 
                written recursive descent parser. 
            </p>
            
<p>
                Formula tokens in Excel are stored in one of three possible <em> operand 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
                occurrence 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.)
            </p>
            
<p>Check out the <a href="http://poi.apache.org/apidocs/">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-2011&nbsp;The Apache Software Foundation. All rights reserved.<br>
              Apache POI, POI, Apache, the Apache feather logo, and the Apache 
              POI project logo are trademarks of The Apache Software Foundation.
            </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>