<?xml version="1.0" encoding="UTF-8"?>
<!--
   ====================================================================
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   ====================================================================
-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">

<document>
    <header>
        <title>Apache POI - HSSF and XSSF Limitations</title>
        <authors>
            <person email="user@poi.apache.org" name="Glen Stampoultzis" id="GJS"/>
        </authors>
    </header>
    <body>
        <section><title>Current HSSF / XSSF main limitations</title>
            <p>
                The intent of this document is to outline some of the known limitations of the
                POI HSSF and XSSF APIs.  It is not intended to be complete list of every bug
                or missing feature of HSSF or XSSF, rather it's purpose is to provide a broad
                feel for some of the functionality that is missing or broken.
            </p>
            <ul>
                <li>
                    File sizes/Memory usage<br/><br/>
					<ul>
						<li>
							There are some inherent limits in the Excel file formats. These are defined in class 
							<a href="../../apidocs/dev/org/apache/poi/ss/SpreadsheetVersion.html">SpreadsheetVersion</a>.
							As long as you have enough main-memory, you should be able to handle files up to these limits. For huge files 
							using the default POI classes you will likely need a very large amount of memory.
							<br/>
							<br/>
							There are ways to overcome the main-memory limitations if needed:
							<br/>
							<ul>
								<li>
									For writing very huge files, there is <a href="site:spreadsheet">SXSSFWorkbook</a> 
									which allows to do a streaming write of data out to files (with certain limitations on what you can do as only 
									parts of the file are held in memory).
								</li>
								<li>
									For reading very huge files, take a look at the sample 
									<a href="https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java">XLSX2CSV</a> 
									which shows how you can read a file in streaming fashion (again with some limitations on what information you 
									can read out of the file, but there are ways to get at most of it if necessary).
								</li>
							</ul>
						</li>
					</ul>
                </li>
                <li>
                    Charts<br/><br/>
					<ul>
						<li>
							HSSF has some limited support for creating a handful of very simple Chart types,
							but largely this isn't supported. HSSF (largely) doesn't support changing Charts.
							You can however create a chart in Excel using Named ranges, modify the chart data
							values using HSSF and write a new spreadsheet out.  This is possible because POI
							attempts to keep existing records intact as far as possible.<br/>
						</li>
						<li>
							XSSF has only limited chart support including making some simple changes 
							and adding at least some line and scatter charts, see the examples <em>LineChart</em> 
							and <em>ScatterChart</em>.<br/><br/>
						</li>
					</ul>
                </li>
                <li>
                    Macros<br/><br/>
                    Macros can not be created. The are currently no plans to support macros.
                    However, reading and re-writing files containing macros will safely preserve 
                    the macros. Recent versions of Apache POI support extracting the macro data
					via <a href="../../apidocs/dev/org/apache/poi/poifs/macros/VBAMacroExtractor.html">VBAMacroExtractor</a>
					and <a href="../../apidocs/dev/org/apache/poi/poifs/macros/VBAMacroReader.html">VBAMacroReader</a><br/><br/>
                </li>
                <li>
                    Pivot Tables<br/><br/>
                    HSSF doesn't have support for reading or creating Pivot tables. XSSF has limited
                    support for creating Pivot Tables, and very limited read/change support.
                </li>
            </ul>
        </section>
    </body>
</document>
