Author: kiwiwings
Date: Thu Jul 19 17:36:35 2018
New Revision: 1836282
URL: http://svn.apache.org/viewvc?rev=1836282&view=rev
Log:
Fix faq-ids to last release of Forrest 0.51
Modified:
poi/site/publish/help/faq.html
Modified: poi/site/publish/help/faq.html
URL:
http://svn.apache.org/viewvc/poi/site/publish/help/faq.html?rev=1836282&r1=1836281&r2=1836282&view=diff
==============================================================================
--- poi/site/publish/help/faq.html (original)
+++ poi/site/publish/help/faq.html Thu Jul 19 17:36:35 2018
@@ -141,8 +141,8 @@ document.write("Last Published: " + docu
My code uses some new feature, compiles fine but fails when live with a
"MethodNotFoundException" or "IncompatibleClassChangeError"
</h2>
<div class="section">
-<p>You almost certainly have an older version of Apache POI
- on your classpath. Quite a few runtimes and other packages
+<p>You almost certainly have an older version of Apache POI
+ on your classpath. Quite a few runtimes and other packages
will ship older version of Apache POI, so this is an easy problem
to hit without your realising. Some will ship just one old jar,
some may ship a full set of old POI jars.</p>
@@ -166,8 +166,7 @@ System.out.println("POI OOXML came from
classloader =
org.apache.poi.hslf.usermodel.HSLFSlideShow.class.getClassLoader();
res =
classloader.getResource("org/apache/poi/hslf/usermodel/HSLFSlideShow.class");
path = res.getPath();
-System.out.println("POI Scratchpad came from " + path);
- </pre>
+System.out.println("POI Scratchpad came from " + path);</pre>
</div>
<a name="faq-N10019"></a>
<h2 class="boxed">2.
@@ -183,15 +182,15 @@ System.out.println("POI Scratchpad came
</h2>
<div class="section">
<p>To use the new OOXML file formats, POI requires a jar containing
- the file format XSDs, as compiled by
+ the file format XSDs, as compiled by
<a href="https://xmlbeans.apache.org/">XMLBeans</a>. These
XSDs, once compiled into Java classes, live in the
<em>org.openxmlformats.schemas</em> namespace.</p>
<p>There are two jar files available, as described in
<a href="../components/">the components overview section</a>.
- The <em>full jar of all of the schemas is ooxml-schemas-1.3.jar</em>,
- and it is currently around 15mb. The <em>smaller poi-ooxml-schemas
- jar</em> is only about 4mb. This latter jar file only contains the
+ The <em>full jar of all of the schemas is ooxml-schemas-1.3.jar</em>,
+ and it is currently around 15mb. The <em>smaller poi-ooxml-schemas
+ jar</em> is only about 4mb. This latter jar file only contains the
typically used parts though.</p>
<p>Many users choose to use the smaller poi-ooxml-schemas jar to save
space. However, the poi-ooxml-schemas jar only contains the XSDs and
@@ -200,10 +199,10 @@ System.out.println("POI Scratchpad came
isn't included in the minimal poi-ooxml-schemas jar. In this case,
you should switch to the full ooxml-schemas-1.3.jar. Longer term,
you may also wish to submit a new unit test which uses the extra
- parts of the XSDs, so that a future poi-ooxml-schemas jar will
+ parts of the XSDs, so that a future poi-ooxml-schemas jar will
include them.</p>
<p>There are a number of ways to get the full ooxml-schemas-1.3.jar.
- If you are a maven user, see the
+ If you are a maven user, see the
<a href="../components/">the components overview section</a>
for the artifact details to have maven download it for you.
If you download the source release of POI, and/or checkout the
@@ -260,7 +259,7 @@ System.out.println("POI Scratchpad came
</table>
</div>
-<a name="faq-N100B7"></a>
+<a name="faq-N100B6"></a>
<h2 class="boxed">4.
Why is reading a simple sheet taking so long?
</h2>
@@ -272,7 +271,7 @@ System.out.println("POI Scratchpad came
errors are thrown as exceptions, which means you probably don't need
logging.</p>
</div>
-<a name="faq-N100C3"></a>
+<a name="faq-N100C2"></a>
<h2 class="boxed">5.
What is the HSSF "eventmodel"?
</h2>
@@ -282,7 +281,7 @@ System.out.println("POI Scratchpad came
tenfold. It is based on the AWT event model in combination with SAX.
If you need read-only
access, this is the best way to do it.</p>
</div>
-<a name="faq-N100CF"></a>
+<a name="faq-N100CE"></a>
<h2 class="boxed">6.
Why can't read the document I created using Star Office 5.1?
</h2>
@@ -290,7 +289,7 @@ System.out.println("POI Scratchpad came
<p>Star Office 5.1 writes some records using the older BIFF standard. This
causes some problems
with POI which supports only BIFF8.</p>
</div>
-<a name="faq-N100DB"></a>
+<a name="faq-N100DA"></a>
<h2 class="boxed">7.
Why am I getting an exception each time I attempt to read my spreadsheet?
</h2>
@@ -300,7 +299,7 @@ System.out.println("POI Scratchpad came
<a
href="https://issues.apache.org/bugzilla/buglist.cgi?product=POI">Bugzilla.</a>
</p>
</div>
-<a name="faq-N100EA"></a>
+<a name="faq-N100E9"></a>
<h2 class="boxed">8.
How do you tell if a spreadsheet cell contains a date?
</h2>
@@ -310,21 +309,20 @@ System.out.println("POI Scratchpad came
in HSSFDateUtil that checks for this.
Thanks to Jason Hoffman for providing the solution.</p>
<pre class="code">
- case HSSFCell.CELL_TYPE_NUMERIC:
- double d = cell.getNumericCellValue();
- // test if a date!
- if (HSSFDateUtil.isCellDateFormatted(cell)) {
- // format in form of M/D/YY
- cal.setTime(HSSFDateUtil.getJavaDate(d));
- cellText =
- (String.valueOf(cal.get(Calendar.YEAR))).substring(2);
- cellText = cal.get(Calendar.MONTH)+1 + "/" +
- cal.get(Calendar.DAY_OF_MONTH) + "/" +
- cellText;
- }
- </pre>
+case HSSFCell.CELL_TYPE_NUMERIC:
+ double d = cell.getNumericCellValue();
+ // test if a date!
+ if (HSSFDateUtil.isCellDateFormatted(cell)) {
+ // format in form of M/D/YY
+ cal.setTime(HSSFDateUtil.getJavaDate(d));
+ cellText =
+ (String.valueOf(cal.get(Calendar.YEAR))).substring(2);
+ cellText = cal.get(Calendar.MONTH)+1 + "/" +
+ cal.get(Calendar.DAY_OF_MONTH) + "/" +
+ cellText;
+ }</pre>
</div>
-<a name="faq-N100FA"></a>
+<a name="faq-N100F9"></a>
<h2 class="boxed">9.
I'm trying to stream an XLS file from a servlet and I'm having some
trouble. What's the problem?
</h2>
@@ -352,7 +350,7 @@ System.out.println("POI Scratchpad came
<p>
To guarantee opening the file properly in Excel from IE, write out
your file to a
temporary file under your web root from your servlet. Then send an
http response
- to the browser to do a client side redirection to your temp file.
(Note that using a
+ to the browser to do a client side redirection to your temp file.
(Note that using a
server side redirect using RequestDispatcher will not be effective in
this case)
</p>
<p>
@@ -368,7 +366,7 @@ System.out.println("POI Scratchpad came
<a href="https://xml.apache.org/fop">FOP</a>, you will come across
many of the same issues.
</p>
</div>
-<a name="faq-N10124"></a>
+<a name="faq-N10123"></a>
<h2 class="boxed">10.
I want to set a cell format (Data format of a cell) of a excel sheet as
###,###,###.#### or ###,###,###.0000. Is it possible using POI ?
</h2>
@@ -377,7 +375,7 @@ System.out.println("POI Scratchpad came
Yes. You first need to get a DataFormat object from the workbook and
call getFormat with the desired format. Some examples are <a
href="../components/spreadsheet/quick-guide.html#DataFormats">here</a>.
</p>
</div>
-<a name="faq-N10134"></a>
+<a name="faq-N10133"></a>
<h2 class="boxed">11.
I want to set a cell format (Data format of a cell) of a excel sheet as
text. Is it possible using POI ?
</h2>
@@ -386,7 +384,7 @@ System.out.println("POI Scratchpad came
Yes. This is a built-in format for excel that you can get from
DataFormat object using the format string "@". Also, the string "text" will
alias this format.
</p>
</div>
-<a name="faq-N10140"></a>
+<a name="faq-N1013F"></a>
<h2 class="boxed">12.
How do I add a border around a merged cell?
</h2>
@@ -394,7 +392,7 @@ System.out.println("POI Scratchpad came
<p>Add blank cells around where the cells normally would have been and set the
borders individually for each cell.
We will probably enhance HSSF in the future to make this process
easier.</p>
</div>
-<a name="faq-N1014C"></a>
+<a name="faq-N1014B"></a>
<h2 class="boxed">13.
I am using styles when creating a workbook in POI, but Excel refuses to
open the file, complaining about "Too Many Styles".
</h2>
@@ -420,12 +418,12 @@ System.out.println("POI Scratchpad came
style.setFillForegroundColor(HSSFColor.ORANGE.index);
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
- for (int x = 0; x < 1000; x++) {
+ for (int x = 0; x &lt; 1000; x++) {
// Create a row and put some cells in it. Rows are 0 based.
row = sheet.createRow((short) k);
- for (int y = 0; y < 100; y++) {
+ for (int y = 0; y &lt; 100; y++) {
cell = row.createCell((short) k);
cell.setCellValue("X");
cell.setCellStyle(style);
@@ -436,14 +434,14 @@ System.out.println("POI Scratchpad came
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
- </pre>
-<p>BAD:</p>
-<pre class="code">
+ </source>
+ <p>BAD:</p>
+ <source>
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
HSSFRow row = null;
- for (int x = 0; x < 1000; x++) {
+ for (int x = 0; x &lt; 1000; x++) {
// Aqua background
HSSFCellStyle style = wb.createCellStyle();
style.setFillBackgroundColor(HSSFColor.AQUA.index);
@@ -461,7 +459,7 @@ System.out.println("POI Scratchpad came
// Create a row and put some cells in it. Rows are 0 based.
row = sheet.createRow((short) k);
- for (int y = 0; y < 100; y++) {
+ for (int y = 0; y &lt; 100; y++) {
cell = row.createCell((short) k);
cell.setCellValue("X");
cell.setCellStyle(style);
@@ -471,10 +469,9 @@ System.out.println("POI Scratchpad came
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
- fileOut.close();
- </pre>
+ fileOut.close();</pre>
</div>
-<a name="faq-N10166"></a>
+<a name="faq-N10165"></a>
<h2 class="boxed">14.
I think POI is using too much memory! What can I do?
</h2>
@@ -497,7 +494,7 @@ System.out.println("POI Scratchpad came
or SXSSF), the number rows, the number of columns, and if the file
should be saved. If you can't run that with 50,000 rows and 50 columns
in HSSF and SXSSF in under 3 seconds, and XSSF in under 20 seconds
- (and ideally all 3 in less than that!), then the problem is with
+ (and ideally all 3 in less than that!), then the problem is with
your environment.</p>
<p>Next, use the example program
<a
href="https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/ss/examples/ToCSV.java">ToCSV</a>
@@ -512,14 +509,14 @@ System.out.println("POI Scratchpad came
files). If these tests are fast, then performance problems likely are in
your
code.</p>
</div>
-<a name="faq-N10193"></a>
+<a name="faq-N10192"></a>
<h2 class="boxed">15.
I can't seem to find the source for the OOXML CT.. classes, where do they
come from?
</h2>
<div class="section">
<p>The OOXML support in Apache POI is built on top of the file format
- XML Schemas, as compiled into Java using
+ XML Schemas, as compiled into Java using
<a href="https://xmlbeans.apache.org/">XMLBeans</a>. Currently,
the compilation is done with XMLBeans 2.3, for maximum compatibility
with installations. (You can use the resulting classes on the XMLBeans
@@ -530,38 +527,38 @@ System.out.println("POI Scratchpad came
classes are auto-generated by XMLBeans. The resulting generated Java
goes
in the <em>ooxml-schemas-src</em> jar, and the compiled version into
the
<em>ooxml-schemas</em> jar.</p>
-<p>The full <em>ooxml-schemas</em> jar is distributed with Apache POI,
+<p>The full <em>ooxml-schemas</em> jar is distributed with Apache POI,
along with the cut-down <em>poi-ooxml-schemas</em> jar containing just
the common parts. The source jar isn't normally distributed with POI.
It is, however, available from Maven Central - ask your favourite
Maven
mirror for the <em>ooxml-schemas-src</em> jar. Alternately, if you
download
the POI source distribution (or checkout from SVN) and build, Ant will
- automatically download the specification XML Schema, and compile it
for
+ automatically download the specification XML Schema, and compile it
for
you to generate the source and binary ooxml-schemas jars.</p>
</div>
-<a name="faq-N101BB"></a>
+<a name="faq-N101BA"></a>
<h2 class="boxed">16.
An OLE2 ("binary") file is giving me problems, but I can't share it. How
can I investigate the problem on my own?
</h2>
<div class="section">
-<p>The first thing to try is running the
+<p>The first thing to try is running the
<a
href="https://blogs.msdn.com/b/officeinteroperability/archive/2011/07/12/microsoft-office-binary-file-format-validator-is-now-available.aspx">Binary
File Format Validator</a>
from Microsoft against the file, which will report if the file
complies with the specification. If your input file doesn't, then this
- may well explain why POI isn't able to process it correctly. You
+ may well explain why POI isn't able to process it correctly. You
should probably in this case speak to whoever is generating the file,
and have them fix it there. If your POI generated file is identified
- as having an issue, and you're on the
+ as having an issue, and you're on the
<a href="../devel/index.html">latest codebase</a>, report a new
POI bug and include the details of the validation failure.</p>
<p>Another thing to try, especially if the file is valid but POI isn't
behaving as expected, are the POI Dev Tools for the component you're
using. For example, HSSF has
<em>org.apache.poi.hssf.dev.BiffViewer</em>
which will allow you to view the file as POI does. This will often
- allow you to check that things are being read as you expect, and
+ allow you to check that things are being read as you expect, and
narrow in on problem records and structures.</p>
</div>
-<a name="faq-N101D5"></a>
+<a name="faq-N101D4"></a>
<h2 class="boxed">17.
An OOXML ("xml") file is giving me problems, but I can't share it. How
can I investigate the problem on my own?
</h2>
@@ -572,20 +569,20 @@ System.out.println("POI Scratchpad came
<p>Files such as .xlsx, .docx and .pptx are actually a zip file of XML
files, with a special structure. Your first step in diagnosing the
issues with the input or output file will likely be to unzip the
- file, and look at the XML of it. Newer versions of Office will
- normally tell you which area of the file is problematic, so
+ file, and look at the XML of it. Newer versions of Office will
+ normally tell you which area of the file is problematic, so
narrow in on there. Looking at the XML, does it look correct?</p>
<p>When reporting bugs, ideally include the whole file, but if you're
unable to then include the snippet of XML for the problem area, and
reference the OOXML standard for what it should contain.</p>
</div>
-<a name="faq-N101E7"></a>
+<a name="faq-N101E6"></a>
<h2 class="boxed">18.
Why do I get a java.lang.NoClassDefFoundError:
javax/xml/stream/XMLEventFactory.newFactory()
</h2>
<div class="section">
-<p>This error indicates that the class XMLEventFactory does not provide
- functionality which POI is depending upon. There can be a number of
+<p>This error indicates that the class XMLEventFactory does not provide
+ functionality which POI is depending upon. There can be a number of
different reasons for this:</p>
<ul>
@@ -597,20 +594,20 @@ System.out.println("POI Scratchpad came
</li>
<li>Running IBM Java 6 (potentially as part of WebSphere Application
Server):<br>
- IBM Java 6 does not provide all the interfaces required by the XML
standards,
+ IBM Java 6 does not provide all the interfaces required by the XML
standards,
only IBM Java 7 seems to provide the correct interfaces, so try
upgrading
your JDK.
</li>
<li>Sun/Oracle Java 6 with outdated patchlevel:<br>
Some of the interfaces were only included/fixed in some of the
patchlevels for
- Java 6. Try running with the latest available patchlevel or even
better use
+ Java 6. Try running with the latest available patchlevel or even
better use
Java 7/8 where this functionality should be available in all cases.
</li>
</ul>
</div>
-<a name="faq-N10205"></a>
+<a name="faq-N10204"></a>
<h2 class="boxed">19.
Can I mix POI jars from different versions?
</h2>
@@ -620,13 +617,13 @@ System.out.println("POI Scratchpad came
such as <em>poi-3.11.jar</em> and <em>poi-ooxml-3.9.jar</em> is not
supported, and will fail to work in unpredictable ways.</p>
<p>If you're not sure which POI jars you're using at runtime, and/or
- you suspect it might not be the one you intended, see
+ you suspect it might not be the one you intended, see
<a href="#faq-N10006">this FAQ entry</a> for details on
diagnosing it. If you aren't sure what POI jars you need, see the
<a href="../components/">Components Overview</a>
for details</p>
</div>
-<a name="faq-N10225"></a>
+<a name="faq-N10224"></a>
<h2 class="boxed">20.
Can I access/modify workbooks/documents/slideshows in multiple
threads?
What are the multi-threading guarantees that Apache POI makes
@@ -648,7 +645,7 @@ System.out.println("POI Scratchpad came
versions of Apache POI as we do not specifically test using
the library
this way.</p>
</div>
-<a name="faq-N1023D"></a>
+<a name="faq-N1023C"></a>
<h2 class="boxed">21.
What are the advantages and disadvantages of the different constructor
and
write methods?
@@ -679,13 +676,13 @@ and
</p>
<p>You can also write out to a new <em>File</em>. This is available no matter
how
you opened the document, and will create/replace a new file. It is
faster and lower
- memory than writing to an <em>OutputStream</em>. However, you can't use
this to
+ memory than writing to an <em>OutputStream</em>. However, you can't use
this to
replace the currently open file, only files not currently open. To
write to a
new / different file, use
<a
href="../apidocs/org/apache/poi/POIDocument.html#write(java.io.File)">write(File)</a>
</p>
-<p>More information is also available in the
+<p>More information is also available in the
<a href="../components/spreadsheet/quick-guide.html#FileInputStream">HSSF and
XSSF documentation</a>,
which largely applies to the other formats too.
</p>
@@ -693,7 +690,7 @@ and
for the OOXML formats yet.
</p>
</div>
-<a name="faq-N1029D"></a>
+<a name="faq-N1029C"></a>
<h2 class="boxed">22.
Can POI be used with OSGI?
</h2>
@@ -711,7 +708,7 @@ and
</p>
</div>
-<a name="faq-N102B1"></a>
+<a name="faq-N102B0"></a>
<h2 class="boxed">23.
Can Apache POI be compiled/used with Java 9?
</h2>
@@ -760,9 +757,10 @@ and
-Djava.locale.providers=JRE,CLDR \
-Dcoverage.enabled=true \
test-all
+
</pre>
</div>
-<a name="faq-N102CA"></a>
+<a name="faq-java10"></a>
<h2 class="boxed">24.
Can Apache POI be compiled/used with Java 10 or newer?
</h2>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]