Create XSSFWorkbook

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Create XSSFWorkbook

tony@tamborine.to
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Create XSSFWorkbook

Nick Burch-2
On Fri, 7 Sep 2018, [hidden email] wrote:
> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Create XSSFWorkbook

tony@tamborine.to
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

On 7 September 2018 at 16:08, Nick Burch <[hidden email]> wrote:

> On Fri, 7 Sep 2018, [hidden email] wrote:
>
>> 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
>
Reply | Threaded
Open this post in threaded view
|

Re: Create XSSFWorkbook

Nick Burch-2
On Fri, 7 Sep 2018, Tony Obermeit wrote:
> 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.

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Create XSSFWorkbook

tony@tamborine.to
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.

On 7 September 2018 at 16:29, Nick Burch <[hidden email]> wrote:

> On Fri, 7 Sep 2018, Tony Obermeit wrote:
>
>> 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.
>>
>
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>