Modified: poi/site/publish/components/spreadsheet/how-to.html URL: http://svn.apache.org/viewvc/poi/site/publish/components/spreadsheet/how-to.html?rev=1836244&r1=1836243&r2=1836244&view=diff ============================================================================== --- poi/site/publish/components/spreadsheet/how-to.html (original) +++ poi/site/publish/components/spreadsheet/how-to.html Wed Jul 18 23:27:21 2018 @@ -1,209 +1,298 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!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"> +<meta content="Apache Forrest" name="Generator"> +<meta name="Forrest-version" content="0.9"> +<meta name="Forrest-skin-name" content="pelt"> <title>The New Halloween Document</title> +<link type="text/css" href="../../skin/basic.css" rel="stylesheet"> +<link media="screen" type="text/css" href="../../skin/screen.css" rel="stylesheet"> +<link media="print" type="text/css" href="../../skin/print.css" rel="stylesheet"> +<link type="text/css" href="../../skin/profile.css" rel="stylesheet"> +<script src="../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../skin/fontsize.js" language="javascript" type="text/javascript"></script> +<link rel="shortcut icon" href="../../images/favicon.ico"> </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="https://www.apache.org"><img border="0" class="logoImage" alt="The Apache Software Foundation" src="../resources/images/asf_logo.png"></a> -</div> -</td> -<!--================= end Group Logo ==================--> -<!--================= start Project Logo ==================--><td width="50%" align="right"> -<div align="right" class="projectLogo"> -<a href="https://donate.apache.org/"><img border="0" class="logoImage" alt="Support Apache" src="../resources/images/support-asf.png" width="120" height="120" title="Your donation helps The Apache Software Foundation ensure its community-driven software remains available to billions of users at absolutely no cost."></a><a href="https://poi.apache.org/"><img border="0" class="logoImage" alt="Apache POI" src="../resources/images/pb-poi.png" width="120" height="120" title="Apache POI - the Java API for Microsoft Documents"></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="https://www.apache.org/">Apache</a> | <a href="https://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> +<body onload="init()"> +<script type="text/javascript">ndeSetTextSize();</script> +<div id="top"> +<!--+ + |breadtrail + +--> +<div class="breadtrail"> +<a href="https://www.apache.org">Apache Software Foundation</a> > <a href="https://poi.apache.org">Apache POI</a><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script> +</div> +<!--+ + |header + +--> +<div class="header"> +<!--+ + |start group logo + +--> +<div class="grouplogo"> +<a href="https://www.apache.org"><img class="logoImage" alt="Apache Software Foundation" src="../../images/group-logo.png" title="The Apache Software Foundation is a cornerstone of the modern Open Source software ecosystem – supporting some of the most widely used and important software solutions powering today's Internet economy."></a> +</div> +<!--+ + |end group logo + +--> +<!--+ + |start Project Logo + +--> +<div class="projectlogo"> +<a href="https://poi.apache.org"><img class="logoImage" alt="Apache POI" src="../../images/project-logo.png" title="Apache POI is well-known in the Java field as a library for reading and writing Microsoft Office file formats, such as Excel, PowerPoint, Word, Visio, Publisher and Outlook. It supports both the older (OLE2) and new (OOXML - Office Open XML) formats."></a> +</div> +<!--+ + |end Project Logo + +--> +<!--+ + |start Search + +--> +<div class="searchbox"> +<form action="http://www.google.com/search" method="get" class="roundtopsmall"> +<input value="poi.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google"> + <input name="Search" value="Search" type="submit"> +</form> </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> +<!--+ + |end search + +--> +<!--+ + |start Tabs + +--> +<ul id="tabs"> +<li> +<a class="unselected" href="../../index.html">Home</a> +</li> +<li> +<a class="unselected" href="../../help/index.html">Help</a> +</li> +<li class="current"> +<a class="selected" href="../../components/index.html">Component APIs</a> +</li> +<li> +<a class="unselected" href="../../devel/index.html">Getting Involved</a> +</li> +</ul> +<!--+ + |end Tabs + +--> </div> - </div> -<div class="menu"> -<span class="menuLabel">HSSF+XSSF</span> - -<div class="menuItem"> -<a href="index.html">Overview</a> +<div id="main"> +<div id="publishedStrip"> +<!--+ + |start Subtabs + +--> +<div id="level2tabs"></div> +<!--+ + |end Endtabs + +--> +<script type="text/javascript"><!-- +document.write("Last Published: " + document.lastModified); +// --></script> </div> - -<div class="menuItem"> -<a href="quick-guide.html">Quick Guide</a> +<!--+ + |breadtrail + +--> +<div class="breadtrail"> + + + </div> +<!--+ + |start Menu, mainarea + +--> +<!--+ + |start Menu + +--> +<div id="menu"> +<div onclick="SwitchMenu('menu_selected_1.1', '../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Component APIs</div> +<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;"> +<div class="menuitem"> +<a href="../../components/index.html">Overview</a> </div> - -<div class="menuItem"> -<span class="menuSelected">HOWTO</span> +<div class="menuitem"> +<a href="../../apidocs/index.html">Javadocs</a> </div> - -<div class="menuItem"> -<a href="converting.html">HSSF to SS Converting</a> +<div onclick="SwitchMenu('menu_selected_1.1.3', '../../skin/')" id="menu_selected_1.1.3Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Excel (HSSF/XSSF)</div> +<div id="menu_selected_1.1.3" class="selectedmenuitemgroup" style="display: block;"> +<div class="menuitem"> +<a href="../../components/spreadsheet/index.html">Overview</a> </div> - -<div class="menuItem"> -<a href="formula.html">Formula Support</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/quick-guide.html">Quick Guide</a> </div> - -<div class="menuItem"> -<a href="eval.html">Formula Evaluation</a> +<div class="menupage"> +<div class="menupagetitle">HOWTO</div> </div> - -<div class="menuItem"> -<a href="eval-devguide.html">Eval Dev Guide</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/converting.html">HSSF to SS Converting</a> </div> - -<div class="menuItem"> -<a href="examples.html">Examples</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/formula.html">Formula Support</a> </div> - -<div class="menuItem"> -<a href="use-case.html">Use Case</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/eval.html">Formula Evaluation</a> </div> - -<div class="menuItem"> -<a href="diagrams.html">Pictorial Docs</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/eval-devguide.html">Eval Dev Guide</a> </div> - -<div class="menuItem"> -<a href="limitations.html">Limitations</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/examples.html">Examples</a> </div> - -<div class="menuItem"> -<a href="user-defined-functions.html">User Defined Functions</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/use-case.html">Use Case</a> </div> - -<div class="menuItem"> -<a href="excelant.html">ExcelAnt Tests</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/diagrams.html">Pictorial Docs</a> </div> - +<div class="menuitem"> +<a href="../../components/spreadsheet/limitations.html">Limitations</a> </div> -<div class="menu"> -<span class="menuLabel">Contributer's Guide</span> - -<div class="menuItem"> -<a href="hacking-hssf.html">Hacking HSSF</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/user-defined-functions.html">User Defined Functions</a> </div> - -<div class="menuItem"> -<a href="record-generator.html">Record Generator</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/excelant.html">ExcelAnt Tests</a> </div> - -<div class="menuItem"> -<a href="chart.html">Charts</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/hacking-hssf.html">Hacking HSSF</a> </div> - +<div class="menuitem"> +<a href="../../components/spreadsheet/record-generator.html">Record Generator</a> </div> -<center> -<a href="https://www.apache.org/events/current-event.html"><img src="https://www.apache.org/events/current-event-125x125.png"></a> -</center> -</div> -</div> -<form target="_blank" action="https://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>The New Halloween Document</h1> +<div class="menuitem"> +<a href="../../components/spreadsheet/chart.html">Charts</a> </div> -<div class="h3"> - - +</div> +<div onclick="SwitchMenu('menu_1.1.4', '../../skin/')" id="menu_1.1.4Title" class="menutitle">PowerPoint (HSLF/XSLF)</div> +<div id="menu_1.1.4" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/slideshow/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/quick-guide.html">Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/how-to-shapes.html">HSLF Cookbook</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/xslf-cookbook.html">XSLF Cookbook</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/ppt-file-format.html">PPT File Format</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.5', '../../skin/')" id="menu_1.1.5Title" class="menutitle">Word (HWPF/XWPF)</div> +<div id="menu_1.1.5" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/document/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/document/quick-guide.html">HWPF Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/document/quick-guide-xwpf.html">XWPF Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/document/docoverview.html">HWPF Format</a> +</div> +<div class="menuitem"> +<a href="../../components/document/projectplan.html">HWPF Project plan</a> +</div> +</div> +<div class="menuitem"> +<a href="../../components/hsmf/index.html">Outlook (HSMF)</a> +</div> +<div class="menuitem"> +<a href="../../components/diagram/index.html">Visio (HDGF+XDGF)</a> +</div> +<div onclick="SwitchMenu('menu_1.1.8', '../../skin/')" id="menu_1.1.8Title" class="menutitle">Publisher (HPBF)</div> +<div id="menu_1.1.8" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/hpbf/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/hpbf/file-format.html">File Format</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.9', '../../skin/')" id="menu_1.1.9Title" class="menutitle">OLE2 Filesystem (POIFS)</div> +<div id="menu_1.1.9" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/poifs/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/how-to.html">How To</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/embeded.html">Embedded Documents</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/fileformat.html">File System Documentation</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/usecases.html">Use Cases</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/design.html">Design</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.10', '../../skin/')" id="menu_1.1.10Title" class="menutitle">OLE2 Document Props (HPSF)</div> +<div id="menu_1.1.10" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/hpsf/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/how-to.html">How To</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/thumbnails.html">Thumbnails</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/internals.html">Internals</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/todo.html">To Do</a> +</div> +</div> +<div class="menuitem"> +<a href="../../components/hmef/index.html">TNEF (HMEF) for winmail.dat</a> +</div> +<div class="menuitem"> +<a href="../../components/oxml4j/index.html">OpenXML4J (OOXML)</a> +</div> +<div class="menuitem"> +<a href="../../components/logging.html">Logging framework</a> +</div> +</div> +<div id="credit"></div> +<div id="roundbottom"> +<img style="display: none" class="corner" height="15" width="15" alt="" src="../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div> +<!--+ + |alternative credits + +--> +<div id="credit2"> +<a href="https://donate.apache.org/"><img border="0" title="Support Apache" alt="Support Apache - logo" src="../../images/support-asf.png" style="width: 125px;height: 125px;"></a> +</div> +</div> +<!--+ + |end Menu + +--> +<!--+ + |start content + +--> +<div id="content"> +<h1>The New Halloween Document</h1> +<div id="front-matter"></div> <a name="How+to+use+the+HSSF+API"></a> -<div class="h3"> -<h3>How to use the HSSF API<a title="Permanent link" class="headerlink" href="#How+to+use+the+HSSF+API">#</a> -</h3> -</div> - - +<h2 class="boxed">How to use the HSSF API</h2> +<div class="section"> <a name="Capabilities"></a> -<div class="h4"> -<h4>Capabilities<a title="Permanent link" class="headerlink" href="#Capabilities">#</a> -</h4> -</div> - +<h3 class="boxed">Capabilities</h3> <p>This release of the how-to outlines functionality for the current svn trunk. Those looking for information on previous releases should look in the documentation distributed with that release.</p> - <p> HSSF allows numeric, string, date or formula cell values to be written to or read from an XLS file. Also @@ -215,18 +304,11 @@ if (VERSION > 3) { and is intended for intermediate developers who need a smaller memory footprint. </p> - - <a name="Different+APIs"></a> -<div class="h4"> -<h4>Different APIs<a title="Permanent link" class="headerlink" href="#Different+APIs">#</a> -</h4> -</div> - +<h3 class="boxed">Different APIs</h3> <p>There are a few different ways to access the HSSF API. These have different characteristics, so you should read up on all to select the best for you.</p> - <ul> <li> @@ -254,33 +336,18 @@ if (VERSION > 3) { </li> </ul> - - +</div> <a name="General+Use"></a> -<div class="h3"> -<h3>General Use<a title="Permanent link" class="headerlink" href="#General+Use">#</a> -</h3> -</div> - -<a name="user_api"></a> - <a name="User+API+%28HSSF+and+XSSF%29"></a> -<div class="h4"> -<h4>User API (HSSF and XSSF)<a title="Permanent link" class="headerlink" href="#User+API+%28HSSF+and+XSSF%29">#</a> -</h4> -</div> - +<h2 class="boxed">General Use</h2> +<div class="section"> +<a name="user_api" id="user_api"></a><a name="User+API+%28HSSF+and+XSSF%29"></a> +<h3 class="boxed">User API (HSSF and XSSF)</h3> <a name="Writing+a+new+file"></a> -<div class="h2"> -<h2>Writing a new file<a title="Permanent link" class="headerlink" href="#Writing+a+new+file">#</a> -</h2> -</div> - - +<h4>Writing a new file</h4> <p>The high level API (package: org.apache.poi.ss.usermodel) is what most people should use. Usage is very simple. </p> - <p>Workbooks are created by creating an instance of org.apache.poi.ss.usermodel.Workbook. Either create a concrete class directly @@ -289,7 +356,6 @@ if (VERSION > 3) { the handy factory class org.apache.poi.ss.usermodel.WorkbookFactory. </p> - <p>Sheets are created by calling createSheet() from an existing instance of Workbook, the created sheet is automatically added in sequence to the workbook. Sheets do not in themselves have a sheet @@ -302,7 +368,6 @@ if (VERSION > 3) { encoding for HSSF is 8bit per char. For XSSF, the name is automatically handled as unicode. </p> - <p>Rows are created by calling createRow(rowNumber) from an existing instance of Sheet. Only rows that have cell values should be added to the sheet. To set the row's height, you just call @@ -310,7 +375,6 @@ if (VERSION > 3) { twips, or 1/20th of a point. If you prefer, there is also a setRowHeightInPoints method. </p> - <p>Cells are created by calling createCell(column, type) from an existing Row. Only cells that have values should be added to the row. Cells should have their cell type set to either @@ -321,7 +385,6 @@ if (VERSION > 3) { width; you must call setColumnWidth(colindex, width) (use units of 1/256th of a character) on the Sheet object. (You can't do it on an individual basis in the GUI either).</p> - <p>Cells are styled with CellStyle objects which in turn contain a reference to an Font object. These are created via the Workbook object by calling createCellStyle() and createFont(). @@ -329,17 +392,14 @@ if (VERSION > 3) { borders, etc). To set a font for an CellStyle call setFont(fontobj). </p> - <p>Once you have generated your workbook, you can write it out by calling write(outputStream) from your instance of Workbook, passing it an OutputStream (for instance, a FileOutputStream or ServletOutputStream). You must close the OutputStream yourself. HSSF does not close it for you. </p> - <p>Here is some example code (excerpted and adapted from org.apache.poi.hssf.dev.HSSF test class):</p> - <pre class="code"> short rownum; @@ -484,15 +544,8 @@ wb.removeSheetAt(1); wb.write(out); out.close(); </pre> - - <a name="Reading+or+modifying+an+existing+file"></a> -<div class="h2"> -<h2>Reading or modifying an existing file<a title="Permanent link" class="headerlink" href="#Reading+or+modifying+an+existing+file">#</a> -</h2> -</div> - - +<h4>Reading or modifying an existing file</h4> <p>Reading in a file is equally simple. To read in a file, create a new instance of org.apache.poi.poifs.Filesystem, passing in an open InputStream, such as a FileInputStream for your XLS, to the constructor. Construct a new instance of @@ -501,27 +554,15 @@ Filesystem instance to the constructor. all of the high level model objects through their assessor methods (workbook.getSheet(sheetNum), sheet.getRow(rownum), etc). </p> - <p>Modifying the file you have read in is simple. You retrieve the object via an assessor method, remove it via a parent object's remove method (sheet.removeRow(hssfrow)) and create objects just as you would if creating a new xls. When you are done modifying cells just call workbook.write(outputstream) just as you did above.</p> - <p>An example of this can be seen in <a href="http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/HSSFReadWrite.java">org.apache.poi.hssf.usermodel.examples.HSSFReadWrite</a>.</p> - - - - -<a name="event_api"></a> - <a name="Event+API+%28HSSF+Only%29"></a> -<div class="h4"> -<h4>Event API (HSSF Only)<a title="Permanent link" class="headerlink" href="#Event+API+%28HSSF+Only%29">#</a> -</h4> -</div> - - +<a name="event_api" id="event_api"></a><a name="Event+API+%28HSSF+Only%29"></a> +<h3 class="boxed">Event API (HSSF Only)</h3> <p>The event API is newer than the User API. It is intended for intermediate developers who are willing to learn a little bit of the low level API structures. Its relatively simple to use, but requires a basic @@ -529,7 +570,6 @@ call workbook.write(outputstream) just a learn). The advantage provided is that you can read an XLS with a relatively small memory footprint. </p> - <p>One important thing to note with the basic Event API is that it triggers events only for things actually stored within the file. With the XLS file format, it is quite common for things that @@ -538,7 +578,6 @@ call workbook.write(outputstream) just a you either need to work around, or use the <a href="#record_aware_event_api">Record Aware</a> extension to the Event API.</p> - <p>To use this API you construct an instance of org.apache.poi.hssf.eventmodel.HSSFRequest. Register a class you create that supports the @@ -552,7 +591,6 @@ call workbook.write(outputstream) just a org.apache.poi.hssf.record package or you can just hack up a copy of org.apache.poi.hssf.dev.EFHSSF and adapt it to your needs. TODO: better documentation on records.</p> - <p>Once you've registered your listeners in the HSSFRequest object you can construct an instance of org.apache.poi.poifs.filesystem.FileSystem (see POIFS howto) and @@ -566,11 +604,9 @@ call workbook.write(outputstream) just a their processRecord(Record) methods with each Record they are registered to listen for until the file has been completely read. </p> - <p>A code excerpt from org.apache.poi.hssf.dev.EFHSSF (which is in CVS or the source distribution) is reprinted below with excessive comments:</p> - <pre class="code"> /** * This example shows how to use the event API for reading a file. @@ -661,16 +697,8 @@ public class EventExample } } </pre> - - - -<a name="record_aware_event_api"></a> - <a name="Record+Aware+Event+API+%28HSSF+Only%29"></a> -<div class="h4"> -<h4>Record Aware Event API (HSSF Only)<a title="Permanent link" class="headerlink" href="#Record+Aware+Event+API+%28HSSF+Only%29">#</a> -</h4> -</div> - +<a name="record_aware_event_api" id="record_aware_event_api"></a><a name="Record+Aware+Event+API+%28HSSF+Only%29"></a> +<h3 class="boxed">Record Aware Event API (HSSF Only)</h3> <p> This is an extension to the normal <a href="#event_api">Event API</a>. With this, your listener @@ -678,11 +706,9 @@ will be called with extra, dummy records alert you to records which aren't present in the file (eg cells that have yet to be edited), and allow you to handle these. </p> - <p> There are three dummy records that your HSSFListener will be called with: </p> - <ul> <li>org.apache.poi.hssf.eventusermodel.dummyrecord.MissingRowDummyRecord @@ -704,14 +730,12 @@ There are three dummy records that your had. For a row with no cells, this will be the only record you get.</li> </ul> - <p> To use the Record Aware Event API, you should create an org.apache.poi.hssf.eventusermodel.MissingRecordAwareHSSFListener, and pass it your HSSFListener. Then, register the MissingRecordAwareHSSFListener to the event model, and start that as normal. </p> - <p> One example use for this API is to write a CSV outputter, which always outputs a minimum number of columns, even where the file doesn't contain @@ -721,25 +745,15 @@ and may be called on the command line, o The latest version is always available from <a href="http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/">subversion</a>. </p> - <p> <em>In POI versions before 3.0.3, this code lived in the scratchpad section. If you're using one of these older versions of POI, you will either need to include the scratchpad jar on your classpath, or build from a</em> - <a href="../subversion.html">subversion checkout</a>. + <a href="../../devel/subversion.html">subversion checkout</a>. </p> - - - -<a name="xssf_sax_api"></a> - <a name="XSSF+and+SAX+%28Event+API%29"></a> -<div class="h4"> -<h4>XSSF and SAX (Event API)<a title="Permanent link" class="headerlink" href="#XSSF+and+SAX+%28Event+API%29">#</a> -</h4> -</div> - - +<a name="xssf_sax_api" id="xssf_sax_api"></a><a name="XSSF+and+SAX+%28Event+API%29"></a> +<h3 class="boxed">XSSF and SAX (Event API)</h3> <p>If memory footprint is an issue, then for XSSF, you can get at the underlying XML data, and process it yourself. This is intended for intermediate developers who are willing to learn a little bit of @@ -748,26 +762,22 @@ The latest version is always available f understanding of the file structure. The advantage provided is that you can read a XLSX file with a relatively small memory footprint. </p> - <p>One important thing to note with the basic Event API is that it triggers events only for things actually stored within the file. With the XLSX file format, it is quite common for things that have yet to be edited to simply not exist in the file. This means there may well be apparent "gaps" in the record stream, which you need to work around.</p> - <p>To use this API you construct an instance of org.apache.poi.xssf.eventmodel.XSSFReader. This will optionally provide a nice interface on the shared strings table, and the styles. It provides methods to get the raw xml data from the rest of the file, which you will then pass to SAX.</p> - <p>This example shows how to get at a single known sheet, or at all sheets in the file. It is based on the example in <a href="http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java">svn src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java</a> </p> - <pre class="code"> import java.io.InputStream; import java.util.Iterator; @@ -888,7 +898,6 @@ public class ExampleEventUserModel { } } </pre> - <p> For a fuller example, including support for fetching number formatting information and applying it to numeric cells (eg to format dates or @@ -896,19 +905,11 @@ public class ExampleEventUserModel { <a href="https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java">the XLSX2CSV example in svn</a> </p> - <p>An example is also <a href="https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java">provided</a> showing how to combine the user API and the SAX API by doing a streaming parse of larger worksheets and a traditional user-model parse of the rest of a workbook.</p> - - -<a name="sxssf"></a> - <a name="SXSSF+%28Streaming+Usermodel+API%29"></a> -<div class="h4"> -<h4>SXSSF (Streaming Usermodel API)<a title="Permanent link" class="headerlink" href="#SXSSF+%28Streaming+Usermodel+API%29">#</a> -</h4> -</div> - +<a name="sxssf" id="sxssf"></a><a name="SXSSF+%28Streaming+Usermodel+API%29"></a> +<h3 class="boxed">SXSSF (Streaming Usermodel API)</h3> <p> SXSSF (package: org.apache.poi.xssf.streaming) is an API-compatible streaming extension of XSSF to be used when very large spreadsheets have to be produced, and heap space is limited. @@ -917,34 +918,28 @@ public class ExampleEventUserModel { document. Older rows that are no longer in the window become inaccessible, as they are written to the disk. </p> - <p> You can specify the window size at workbook construction time via <em>new SXSSFWorkbook(int windowSize)</em> or you can set it per-sheet via <em>SXSSFSheet#setRandomAccessWindowSize(int windowSize)</em> </p> - <p> When a new row is created via createRow() and the total number of unflushed records would exceed the specified window size, then the row with the lowest index value is flushed and cannot be accessed via getRow() anymore. </p> - <p> The default window size is <em>100</em> and defined by SXSSFWorkbook.DEFAULT_WINDOW_SIZE. </p> - <p> A windowSize of -1 indicates unlimited access. In this case all records that have not been flushed by a call to flushRows() are available for random access. </p> - <p> Note that SXSSF allocates temporary files that you <strong>must</strong> always clean up explicitly, by calling the dispose method. - </p> - + </p> <p> SXSSFWorkbook defaults to using inline strings instead of a shared strings table. This is very efficient, since no document content needs to be kept in @@ -953,25 +948,19 @@ public class ExampleEventUserModel { has to be kept in memory. Depending on your document content this could use a lot more resources than with shared strings disabled. </p> - <p> Please note that there are still things that still may consume a large amount of memory based on which features you are using, e.g. merged regions, hyperlinks, comments, ... are still only stored in memory and thus may require a lot of memory if used extensively. </p> - <p> Carefully review your memory budget and compatibility needs before deciding whether to enable shared strings or not. </p> - <p> The example below writes a sheet with a window of 100 rows. When the row count reaches 101, the row with rownum=0 is flushed to disk and removed from memory, when rownum reaches 102 then the row with rownum=1 is flushed, etc. - </p> - - - + </p> <pre class="code"> import junit.framework.Assert; @@ -1015,9 +1004,7 @@ import org.apache.poi.xssf.streaming.SXS </pre> - <p>The next example turns off auto-flushing (windowSize=-1) and the code manually controls how portions of data are written to disk</p> - <pre class="code"> import org.apache.poi.ss.usermodel.Cell; @@ -1058,28 +1045,17 @@ import org.apache.poi.xssf.streaming.SXS </pre> - <p>SXSSF flushes sheet data in temporary files (a temp file per sheet) and the size of these temporary files can grow to a very large value. For example, for a 20 MB csv data the size of the temp xml becomes more than a gigabyte. If the size of the temp files is an issue, you can tell SXSSF to use gzip compression: </p> - <pre class="code"> SXSSFWorkbook wb = new SXSSFWorkbook(); wb.setCompressTempFiles(true); // temp files will be gzipped </pre> - - - -<a name="low_level_api"></a> - <a name="Low+Level+APIs"></a> -<div class="h4"> -<h4>Low Level APIs<a title="Permanent link" class="headerlink" href="#Low+Level+APIs">#</a> -</h4> -</div> - - +<a name="low_level_api" id="low_level_api"></a><a name="Low+Level+APIs"></a> +<h3 class="boxed">Low Level APIs</h3> <p>The low level API is not much to look at. It consists of lots of "Records" in the org.apache.poi.hssf.record.* package, and set of helper classes in org.apache.poi.hssf.model.*. The @@ -1092,35 +1068,20 @@ order to gain a good understanding of ho should view the source in org.apache.poi.hssf.usermodel.* and the classes in org.apache.poi.hssf.model.*. You should read the documentation for the POIFS libraries as well.</p> - - <a name="Generating+XLS+from+XML"></a> -<div class="h4"> -<h4>Generating XLS from XML<a title="Permanent link" class="headerlink" href="#Generating+XLS+from+XML">#</a> -</h4> -</div> - +<h3 class="boxed">Generating XLS from XML</h3> <p>If you wish to generate an XLS file from some XML, it is possible to write your own XML processing code, then use the User API to write out the document.</p> - <p>The other option is to use <a href="http://cocoon.apache.org/">Cocoon</a>. In Cocoon, there is the <a href="http://cocoon.apache.org/2.1/userdocs/xls-serializer.html">HSSF Serializer</a>, which takes in XML (in the gnumeric format), and outputs an XLS file for you.</p> - - <a name="HSSF+Class%2FTest+Application"></a> -<div class="h4"> -<h4>HSSF Class/Test Application<a title="Permanent link" class="headerlink" href="#HSSF+Class%2FTest+Application">#</a> -</h4> -</div> - - +<h3 class="boxed">HSSF Class/Test Application</h3> <p>The HSSF application is nothing more than a test for the high level API (and indirectly the low level support). The main body of its code is repeated above. To run it: </p> - <ul> <li>download the poi-alpha build and untar it (tar xvzf @@ -1138,11 +1099,8 @@ export CLASSPATH=$CLASSPATH:$HSSFDIR/hss </li> </ul> - <p></p> - <p>This should generate a test sheet in your home directory called <span class="codefrag">"myxls.xls"</span>. </p> - <ul> <li>Type: @@ -1156,15 +1114,8 @@ Failing this test is not necessarily a b most likely fail. No big deal. </li> </ul> - - <a name="HSSF+Developer%27s+Tools"></a> -<div class="h4"> -<h4>HSSF Developer's Tools<a title="Permanent link" class="headerlink" href="#HSSF+Developer%27s+Tools">#</a> -</h4> -</div> - - +<h3 class="boxed">HSSF Developer's Tools</h3> <p>HSSF has a number of tools useful for developers to debug/develop stuff using HSSF (and more generally XLS files). We've already discussed the app for testing HSSF read/write/modify capabilities; @@ -1175,7 +1126,6 @@ tools. So we developed BiffViewer. You c org.apache.poi.hssf.dev.BiffViewer. It performs two basic functions and a derivative. </p> - <p>The first is "biffview". To do this you run it (assumes you have everything setup in your classpath and that you know what you're doing enough to be thinking about this) with an xls file as a @@ -1186,32 +1136,20 @@ useful for several things. First, you ca what is wrong in quasi-English. Second, you can send the output to a file and compare it. </p> - <p>The second function is "big freakin dump", just pass a file and a second argument matching "bfd" exactly. This will just make a big hexdump of the file. </p> - <p>Lastly, there is "mixed" mode which does the same as regular biffview, only it includes hex dumps of certain records intertwined. To use that just pass a file with a second argument matching "on" exactly.</p> - <p>In the next release cycle we'll also have something called a FormulaViewer. The class is already there, but its not very useful yet. When it does something, we'll document it.</p> - - - <a name="What%27s+Next%3F"></a> -<div class="h4"> -<h4>What's Next?<a title="Permanent link" class="headerlink" href="#What%27s+Next%3F">#</a> -</h4> -</div> - - +<h3 class="boxed">What's Next?</h3> <p>Further effort on HSSF is going to focus on the following major areas: </p> - <ul> <li>Performance: POI currently uses a lot of memory for large sheets.</li> @@ -1219,57 +1157,40 @@ yet. When it does something, we'll docum <li>Charts: This is a hard problem, with very little documentation.</li> </ul> - <p> -<a href="../guidelines.html"> So jump in! </a> +<a href="../../devel/guidelines.html"> So jump in! </a> </p> - - - - - - -<div id="authors" align="right">by Andrew C. Oliver, Glen Stampoultzis, Nick Burch, Sergei Kozello</div> </div> + +<p align="right"> +<font size="-2">by Andrew C. Oliver, Glen Stampoultzis, Nick Burch, Sergei Kozello</font> +</p> </div> +<!--+ + |end content + +--> +<div class="clearboth"> </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"> +<!--+ + |start bottomstrip + +--> +<div class="lastmodified"> +<script type="text/javascript"><!-- +document.write("Last Published: " + document.lastModified); +// --></script> +</div> <div class="copyright"> - Copyright © 2002-2018 The Apache Software Foundation. All rights reserved.<br> - Apache, Apache POI, and the Apache POI logo are registered trademarks or - trademarks of The Apache Software Foundation in the U.S. and/or other countries. - </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> + Copyright © + 2001-2018 <a href="https://www.apache.org/">The Apache Software Foundation</a> +</div> +<div id="feedback"> + Send feedback about the website to: + <a id="feedbackto" href="mailto:[email protected]?subject=Feedback%C2%A0components/spreadsheet/how-to.html">[email protected]</a> +</div> +<!--+ + |end bottomstrip + +--> </div> -<!--================= end Footer ==================--> </body> </html>
Added: poi/site/publish/components/spreadsheet/images/businessplan.jpg URL: http://svn.apache.org/viewvc/poi/site/publish/components/spreadsheet/images/businessplan.jpg?rev=1836244&view=auto ============================================================================== Binary file - no diff available. Propchange: poi/site/publish/components/spreadsheet/images/businessplan.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: poi/site/publish/components/spreadsheet/images/calculatePayment.jpg URL: http://svn.apache.org/viewvc/poi/site/publish/components/spreadsheet/images/calculatePayment.jpg?rev=1836244&view=auto ============================================================================== Binary file - no diff available. Propchange: poi/site/publish/components/spreadsheet/images/calculatePayment.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: poi/site/publish/components/spreadsheet/images/calendar.jpg URL: http://svn.apache.org/viewvc/poi/site/publish/components/spreadsheet/images/calendar.jpg?rev=1836244&view=auto ============================================================================== Binary file - no diff available. Propchange: poi/site/publish/components/spreadsheet/images/calendar.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: poi/site/publish/components/spreadsheet/images/loancalc.jpg URL: http://svn.apache.org/viewvc/poi/site/publish/components/spreadsheet/images/loancalc.jpg?rev=1836244&view=auto ============================================================================== Binary file - no diff available. Propchange: poi/site/publish/components/spreadsheet/images/loancalc.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: poi/site/publish/components/spreadsheet/images/simple-xls-with-function.jpg URL: http://svn.apache.org/viewvc/poi/site/publish/components/spreadsheet/images/simple-xls-with-function.jpg?rev=1836244&view=auto ============================================================================== Binary file - no diff available. Propchange: poi/site/publish/components/spreadsheet/images/simple-xls-with-function.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: poi/site/publish/components/spreadsheet/images/ss-features.png URL: http://svn.apache.org/viewvc/poi/site/publish/components/spreadsheet/images/ss-features.png?rev=1836244&view=auto ============================================================================== Binary file - no diff available. Propchange: poi/site/publish/components/spreadsheet/images/ss-features.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: poi/site/publish/components/spreadsheet/images/timesheet.jpg URL: http://svn.apache.org/viewvc/poi/site/publish/components/spreadsheet/images/timesheet.jpg?rev=1836244&view=auto ============================================================================== Binary file - no diff available. Propchange: poi/site/publish/components/spreadsheet/images/timesheet.jpg ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: poi/site/publish/components/spreadsheet/index.html URL: http://svn.apache.org/viewvc/poi/site/publish/components/spreadsheet/index.html?rev=1836244&r1=1836243&r2=1836244&view=diff ============================================================================== --- poi/site/publish/components/spreadsheet/index.html (original) +++ poi/site/publish/components/spreadsheet/index.html Wed Jul 18 23:27:21 2018 @@ -1,189 +1,303 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!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>POI-HSSF and POI-XSSF - Java API To Access Microsoft Excel Format Files</title> +<meta content="Apache Forrest" name="Generator"> +<meta name="Forrest-version" content="0.9"> +<meta name="Forrest-skin-name" content="pelt"> +<title>POI-HSSF and POI-XSSF/SXSSF - Java API To Access Microsoft Excel Format Files</title> +<link type="text/css" href="../../skin/basic.css" rel="stylesheet"> +<link media="screen" type="text/css" href="../../skin/screen.css" rel="stylesheet"> +<link media="print" type="text/css" href="../../skin/print.css" rel="stylesheet"> +<link type="text/css" href="../../skin/profile.css" rel="stylesheet"> +<script src="../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../skin/fontsize.js" language="javascript" type="text/javascript"></script> +<link rel="shortcut icon" href="../../images/favicon.ico"> </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="https://www.apache.org"><img border="0" class="logoImage" alt="The Apache Software Foundation" src="../resources/images/asf_logo.png"></a> -</div> -</td> -<!--================= end Group Logo ==================--> -<!--================= start Project Logo ==================--><td width="50%" align="right"> -<div align="right" class="projectLogo"> -<a href="https://donate.apache.org/"><img border="0" class="logoImage" alt="Support Apache" src="../resources/images/support-asf.png" width="120" height="120" title="Your donation helps The Apache Software Foundation ensure its community-driven software remains available to billions of users at absolutely no cost."></a><a href="https://poi.apache.org/"><img border="0" class="logoImage" alt="Apache POI" src="../resources/images/pb-poi.png" width="120" height="120" title="Apache POI - the Java API for Microsoft Documents"></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="https://www.apache.org/">Apache</a> | <a href="https://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> -</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"> -<span class="menuSelected">Overview</span> -</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"> -<a href="formula.html">Formula Support</a> -</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> -<center> -<a href="https://www.apache.org/events/current-event.html"><img src="https://www.apache.org/events/current-event-125x125.png"></a> -</center> -</div> -</div> -<form target="_blank" action="https://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> +<body onload="init()"> +<script type="text/javascript">ndeSetTextSize();</script> +<div id="top"> +<!--+ + |breadtrail + +--> +<div class="breadtrail"> +<a href="https://www.apache.org">Apache Software Foundation</a> > <a href="https://poi.apache.org">Apache POI</a><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script> +</div> +<!--+ + |header + +--> +<div class="header"> +<!--+ + |start group logo + +--> +<div class="grouplogo"> +<a href="https://www.apache.org"><img class="logoImage" alt="Apache Software Foundation" src="../../images/group-logo.png" title="The Apache Software Foundation is a cornerstone of the modern Open Source software ecosystem – supporting some of the most widely used and important software solutions powering today's Internet economy."></a> +</div> +<!--+ + |end group logo + +--> +<!--+ + |start Project Logo + +--> +<div class="projectlogo"> +<a href="https://poi.apache.org"><img class="logoImage" alt="Apache POI" src="../../images/project-logo.png" title="Apache POI is well-known in the Java field as a library for reading and writing Microsoft Office file formats, such as Excel, PowerPoint, Word, Visio, Publisher and Outlook. It supports both the older (OLE2) and new (OOXML - Office Open XML) formats."></a> +</div> +<!--+ + |end Project Logo + +--> +<!--+ + |start Search + +--> +<div class="searchbox"> +<form action="http://www.google.com/search" method="get" class="roundtopsmall"> +<input value="poi.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google"> + <input name="Search" value="Search" type="submit"> </form> -</td> -<!--================= end Menu ==================--> -<!--================= start Content ==================--><td> -<div id="bodycol"> -<div class="app"> -<div align="center"> -<h1>POI-HSSF and POI-XSSF - Java API To Access Microsoft Excel Format Files</h1> </div> -<div class="h3"> - +<!--+ + |end search + +--> +<!--+ + |start Tabs + +--> +<ul id="tabs"> +<li> +<a class="unselected" href="../../index.html">Home</a> +</li> +<li> +<a class="unselected" href="../../help/index.html">Help</a> +</li> +<li class="current"> +<a class="selected" href="../../components/index.html">Component APIs</a> +</li> +<li> +<a class="unselected" href="../../devel/index.html">Getting Involved</a> +</li> +</ul> +<!--+ + |end Tabs + +--> +</div> +</div> +<div id="main"> +<div id="publishedStrip"> +<!--+ + |start Subtabs + +--> +<div id="level2tabs"></div> +<!--+ + |end Endtabs + +--> +<script type="text/javascript"><!-- +document.write("Last Published: " + document.lastModified); +// --></script> +</div> +<!--+ + |breadtrail + +--> +<div class="breadtrail"> - + + </div> +<!--+ + |start Menu, mainarea + +--> +<!--+ + |start Menu + +--> +<div id="menu"> +<div onclick="SwitchMenu('menu_selected_1.1', '../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Component APIs</div> +<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;"> +<div class="menuitem"> +<a href="../../components/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../apidocs/index.html">Javadocs</a> +</div> +<div onclick="SwitchMenu('menu_selected_1.1.3', '../../skin/')" id="menu_selected_1.1.3Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Excel (HSSF/XSSF)</div> +<div id="menu_selected_1.1.3" class="selectedmenuitemgroup" style="display: block;"> +<div class="menupage"> +<div class="menupagetitle">Overview</div> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/quick-guide.html">Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/how-to.html">HOWTO</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/converting.html">HSSF to SS Converting</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/formula.html">Formula Support</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/eval.html">Formula Evaluation</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/eval-devguide.html">Eval Dev Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/examples.html">Examples</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/use-case.html">Use Case</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/diagrams.html">Pictorial Docs</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/limitations.html">Limitations</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/user-defined-functions.html">User Defined Functions</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/excelant.html">ExcelAnt Tests</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/hacking-hssf.html">Hacking HSSF</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/record-generator.html">Record Generator</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/chart.html">Charts</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.4', '../../skin/')" id="menu_1.1.4Title" class="menutitle">PowerPoint (HSLF/XSLF)</div> +<div id="menu_1.1.4" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/slideshow/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/quick-guide.html">Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/how-to-shapes.html">HSLF Cookbook</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/xslf-cookbook.html">XSLF Cookbook</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/ppt-file-format.html">PPT File Format</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.5', '../../skin/')" id="menu_1.1.5Title" class="menutitle">Word (HWPF/XWPF)</div> +<div id="menu_1.1.5" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/document/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/document/quick-guide.html">HWPF Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/document/quick-guide-xwpf.html">XWPF Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/document/docoverview.html">HWPF Format</a> +</div> +<div class="menuitem"> +<a href="../../components/document/projectplan.html">HWPF Project plan</a> +</div> +</div> +<div class="menuitem"> +<a href="../../components/hsmf/index.html">Outlook (HSMF)</a> +</div> +<div class="menuitem"> +<a href="../../components/diagram/index.html">Visio (HDGF+XDGF)</a> +</div> +<div onclick="SwitchMenu('menu_1.1.8', '../../skin/')" id="menu_1.1.8Title" class="menutitle">Publisher (HPBF)</div> +<div id="menu_1.1.8" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/hpbf/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/hpbf/file-format.html">File Format</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.9', '../../skin/')" id="menu_1.1.9Title" class="menutitle">OLE2 Filesystem (POIFS)</div> +<div id="menu_1.1.9" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/poifs/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/how-to.html">How To</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/embeded.html">Embedded Documents</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/fileformat.html">File System Documentation</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/usecases.html">Use Cases</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/design.html">Design</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.10', '../../skin/')" id="menu_1.1.10Title" class="menutitle">OLE2 Document Props (HPSF)</div> +<div id="menu_1.1.10" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/hpsf/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/how-to.html">How To</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/thumbnails.html">Thumbnails</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/internals.html">Internals</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/todo.html">To Do</a> +</div> +</div> +<div class="menuitem"> +<a href="../../components/hmef/index.html">TNEF (HMEF) for winmail.dat</a> +</div> +<div class="menuitem"> +<a href="../../components/oxml4j/index.html">OpenXML4J (OOXML)</a> +</div> +<div class="menuitem"> +<a href="../../components/logging.html">Logging framework</a> +</div> +</div> +<div id="credit"> +<hr> +<a href="https://www.apache.org/events/current-event.html"><img border="0" title="Apache Event" alt="Apache Event - logo" src="http://www.apache.org/events/current-event-125x125.png" style="width: 125px;height: 125px;"></a> +</div> +<div id="roundbottom"> +<img style="display: none" class="corner" height="15" width="15" alt="" src="../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div> +<!--+ + |alternative credits + +--> +<div id="credit2"> +<a href="https://donate.apache.org/"><img border="0" title="Support Apache" alt="Support Apache - logo" src="../../images/support-asf.png" style="width: 125px;height: 125px;"></a> +</div> +</div> +<!--+ + |end Menu + +--> +<!--+ + |start content + +--> +<div id="content"> +<h1>POI-HSSF and POI-XSSF/SXSSF - Java API To Access Microsoft Excel Format Files</h1> +<h3>Overview</h3> +<div id="front-matter"></div> <a name="Overview"></a> -<div class="h3"> -<h3>Overview<a title="Permanent link" class="headerlink" href="#Overview">#</a> -</h3> -</div> - - - +<h2 class="boxed">Overview</h2> +<div class="section"> <p>HSSF is the POI Project's pure Java implementation of the Excel '97(-2007) file format. XSSF is the POI Project's pure Java implementation of the Excel 2007 OOXML (.xlsx) file format.</p> - <p>HSSF and XSSF provides ways to read spreadsheets create, modify, read and write XLS spreadsheets. They provide: </p> - <ul> <li>low level structures for those with special needs</li> @@ -193,31 +307,26 @@ if (VERSION > 3) { <li>a full usermodel api for creating, reading and modifying XLS files</li> </ul> - <p>For people converting from pure HSSF usermodel, who wish to use the joint SS Usermodel for HSSF and XSSF support, then see the <a href="converting.html">ss usermodel converting guide</a>. </p> - <p> An alternate way of generating a spreadsheet is via the <a href="http://cocoon.apache.org">Cocoon</a> serializer (yet you'll still be using HSSF indirectly). With Cocoon you can serialize any XML datasource (which might be a ESQL page outputting in SQL for instance) by simply applying the stylesheet and designating the serializer. </p> - <p> If you're merely reading spreadsheet data, then use the eventmodel api in either the org.apache.poi.hssf.eventusermodel package, or the org.apache.poi.xssf.eventusermodel package, depending on your file format. </p> - <p> If you're modifying spreadsheet data then use the usermodel api. You can also generate spreadsheets this way. </p> - <p> Note that the usermodel system has a higher memory footprint than the low level eventusermodel, but has the major advantage of being @@ -226,21 +335,13 @@ if (VERSION > 3) { the memory footprint for processing them is higher than for the older HSSF supported (.xls) binary files. </p> - - - - - - -<a name="SXSSF+%28Since+POI+3.8+beta3%29"></a> -<div class="h3"> -<h3>SXSSF (Since POI 3.8 beta3)<a title="Permanent link" class="headerlink" href="#SXSSF+%28Since+POI+3.8+beta3%29">#</a> -</h3> </div> -<p>Since 3.8-beta3, POI provides a low-memory footprint SXSSF API built on top of XSSF.</p> - +<a name="SXSSF+%28Since+POI+3.8+beta3%29"></a> +<h2 class="boxed">SXSSF (Since POI 3.8 beta3)</h2> +<div class="section"> +<p>Since 3.8-beta3, POI provides a low-memory footprint SXSSF API built on top of XSSF.</p> <p> SXSSF is an API-compatible streaming extension of XSSF to be used when very large spreadsheets have to be produced, and heap space is limited. @@ -249,19 +350,16 @@ are within a sliding window, while XSSF document. Older rows that are no longer in the window become inaccessible, as they are written to the disk. </p> - <p> In auto-flush mode the size of the access window can be specified, to hold a certain number of rows in memory. When that value is reached, the creation of an additional row causes the row with the lowest index to to be removed from the access window and written to disk. Or, the window size can be set to grow dynamically; it can be trimmed periodically by an explicit call to flushRows(int keepRows) as needed. </p> - <p> Due to the streaming nature of the implementation, there are the following limitations when compared to XSSF: </p> - <ul> <li>Only a limited number of rows are accessible at a point in time.</li> @@ -271,70 +369,51 @@ limitations when compared to XSSF: <li>Formula evaluation is not supported</li> </ul> - - <p> See more details at <a href="how-to.html#sxssf">SXSSF How-To</a> </p> - - -<p>The table below synopsizes the comparative features of POI's Spreadsheet API:</p> - +<p>The table below synopsizes the comparative features of POI's Spreadsheet API:</p> <p> <em>Spreadsheet API Feature Summary</em> </p> - - <p> -<img alt="Spreadsheet API Feature Summary" src="../resources/images/ss-features.png"> +<img alt="Spreadsheet API Feature Summary" src="images/ss-features.png"> </p> - +</div> - -<div id="authors" align="right">by Andrew C. Oliver, Nicola Ken Barozzi</div> -</div> +<p align="right"> +<font size="-2">by Andrew C. Oliver, Nicola Ken Barozzi</font> +</p> </div> +<!--+ + |end content + +--> +<div class="clearboth"> </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"> +<!--+ + |start bottomstrip + +--> +<div class="lastmodified"> +<script type="text/javascript"><!-- +document.write("Last Published: " + document.lastModified); +// --></script> +</div> <div class="copyright"> - Copyright © 2002-2018 The Apache Software Foundation. All rights reserved.<br> - Apache, Apache POI, and the Apache POI logo are registered trademarks or - trademarks of The Apache Software Foundation in the U.S. and/or other countries. - </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"> -<a href="http://validator.w3.org/check/referer"><img width="88" height="31" alt="Valid HTML 4.01!" src="../skin/images/valid-html401.png" class="logoImage"></a><a href="http://jigsaw.w3.org/css-validator/"><img width="88" height="31" alt="Valid CSS!" src="../skin/images/vcss.png" class="logoImage"></a><a href="https://forrest.apache.org/"><img border="0" class="logoImage" alt="Built with Apache Forrest" src="../skin/images/built-with-forrest-button.png" width="88" height="31"></a> -</div> -</div> -<!--================= end Credits ==================--> -</td> -</tr> -</tbody> -</table> + Copyright © + 2001-2018 <a href="https://www.apache.org/">The Apache Software Foundation</a> +</div> +<div id="logos"> +<a href="http://validator.w3.org/check/referer"><img style="height: 31px; width: 88px;" title="Valid HTML 4.01!" alt="Valid HTML 4.01!" src="../../skin/images/valid-html401.png" class="logoImage"></a><a href="http://jigsaw.w3.org/css-validator/check/referer"><img style="height: 31px; width: 88px;" title="Valid CSS!" alt="Valid CSS!" src="../../skin/images/vcss.png" class="logoImage"></a> +</div> +<div id="feedback"> + Send feedback about the website to: + <a id="feedbackto" href="mailto:[email protected]?subject=Feedback%C2%A0components/spreadsheet/index.html">[email protected]</a> +</div> +<!--+ + |end bottomstrip + +--> </div> -<!--================= end Footer ==================--> </body> </html> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
