Discussion:
Create XSSFWorkbook
t***@tamborine.to
2018-09-07 06:00:27 UTC
Permalink
https://poi.apache.org/components/spreadsheet/converting.html

This document and others gives a snippet: new XSSFWorkbook()

or
workbook = new XSSFWorkbook()

This fails: unable to resolve class XSSFWorkbook

I've seen other documentation that says to use the WorkbookFactory, my issue is all of those examples have to do with opening a workbook to read it, I'm purely generating a new workbook and can't work out how to do that. I used to successfully (and still can) do this: HSSFWorkbook workbook = new HSSFWorkbook();

Thanks

Tony

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Nick Burch
2018-09-07 06:08:54 UTC
Permalink
Post by t***@tamborine.to
This document and others gives a snippet: new XSSFWorkbook()
or
workbook = new XSSFWorkbook()
This fails: unable to resolve class XSSFWorkbook
See http://poi.apache.org/components/index.html#components - XSSF (and the
other OOXML classes) require additional jars

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Tony Obermeit
2018-09-07 06:24:31 UTC
Permalink
Thanks. Much progress, now it's failing on:
org.apache.xmlbeans.XmlException. I think that's part of
ooxml-schemas-1.3.jar, trying to find a downloadable jar.

Really appreciate how quickly you replied. Have a super weekend
Post by Nick Burch
Post by t***@tamborine.to
This document and others gives a snippet: new XSSFWorkbook()
or
workbook = new XSSFWorkbook()
This fails: unable to resolve class XSSFWorkbook
See http://poi.apache.org/components/index.html#components - XSSF (and
the other OOXML classes) require additional jars
Nick
Nick Burch
2018-09-07 06:29:08 UTC
Permalink
Post by Tony Obermeit
org.apache.xmlbeans.XmlException. I think that's part of
ooxml-schemas-1.3.jar, trying to find a downloadable jar.
Nope, that's in xmlbeans itself. If you download the binary release of
Apache POI, it's in the ooxml lib directory. I'd recommend using the
latest xmlbeans 3.0.1 jar though from https://xmlbeans.apache.org/ as
there's a few key fixes since 2.6!

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@poi.apache.org
For additional commands, e-mail: user-***@poi.apache.org
Tony Obermeit
2018-09-07 06:50:04 UTC
Permalink
Woo hoo! It was in the ooxml lib directory as you guided. And I had to
get the commons compression libraries in there. You've saved me lots of
time. Now I'm getting a variety of errors where the HSSFSheet has to be
replaced with Sheet, etc. Fonts are same.

From: https://poi.apache.org/components/spreadsheet/converting.html

The new SS usermodel (org.apache.poi.ss.usermodel) is very heavily based on
the old HSSF usermodel (org.apache.poi.hssf.usermodel). The main difference
is that the package name and class names have been tweaked to remove HSSF
from them. Otherwise, the new SS Usermodel interfaces should provide the
same functionality.
Thanks again, you've saved me a lot of time.
Post by Tony Obermeit
org.apache.xmlbeans.XmlException. I think that's part of
ooxml-schemas-1.3.jar, trying to find a downloadable jar.
Nope, that's in xmlbeans itself. If you download the binary release of
Apache POI, it's in the ooxml lib directory. I'd recommend using the latest
xmlbeans 3.0.1 jar though from https://xmlbeans.apache.org/ as there's a
few key fixes since 2.6!
Nick
---------------------------------------------------------------------
Loading...