You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Markus Maria Michaels <lo...@gmail.com> on 2016/11/13 14:38:40 UTC

XLS and XLSX with XSSF

Hey,

is there a way to write the same file as xls and xlsx file ?
For example with XSSF.

I tried writing a xlsx file with HSSF and it works.
Can i use XSSF for XLS and XLSX without any problems?

Thanks a lot.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


RE: XLS and XLSX with XSSF

Posted by "Murphy, Mark" <mu...@metalexmfg.com>.
Yes, but David is correct. Even if you use SS, behind the scenes you are using either HSSF or XSSF depending on how you created your Worksheet object. And there is no way to switch the Worksheet object to the other.

-----Original Message-----
From: MARK GOLDEN [mailto:mark_golden@btopenworld.com] 
Sent: Wednesday, November 16, 2016 12:41 PM
To: POI Users List <us...@poi.apache.org>
Subject: Re: XLS and XLSX with XSSF

Hi,
I think HSSF is for XLS, XSSF is for XLSX and you can use SS for either.
R,Mark.  

    On Wednesday, 16 November 2016, 6:45, David North <dt...@corefiling.co.uk> wrote:
 

 Hi Markus,

This question would be best asked on the POI user list
(user@poi.apache.org) - moving thread there.

> is there a way to write the same file as xls and xlsx file ?
> For example with XSSF.

The APIs require you to pick one or the other - unfortunately although the two share a set of common interfaces, we don't have code to clone one implementation into the other.

> I tried writing a xlsx file with HSSF and it works.

That's surprising. Are you sure it's actually written an .xlsx file (a ZIP with XML inside it)? Or is it the case that Excel happily opens an .xls with the .xlsx extension?

> Can i use XSSF for XLS and XLSX without any problems?
> 
> Thanks a lot.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org For additional 
> commands, e-mail: dev-help@poi.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org



   

Re: XLS and XLSX with XSSF

Posted by MARK GOLDEN <ma...@btopenworld.com>.
Hi,
I think HSSF is for XLS, XSSF is for XLSX and you can use SS for either.
R,Mark.  

    On Wednesday, 16 November 2016, 6:45, David North <dt...@corefiling.co.uk> wrote:
 

 Hi Markus,

This question would be best asked on the POI user list
(user@poi.apache.org) - moving thread there.

> is there a way to write the same file as xls and xlsx file ?
> For example with XSSF.

The APIs require you to pick one or the other - unfortunately although
the two share a set of common interfaces, we don't have code to clone
one implementation into the other.

> I tried writing a xlsx file with HSSF and it works.

That's surprising. Are you sure it's actually written an .xlsx file (a
ZIP with XML inside it)? Or is it the case that Excel happily opens an
.xls with the .xlsx extension?

> Can i use XSSF for XLS and XLSX without any problems?
> 
> Thanks a lot.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org



   

Re: XLS and XLSX with XSSF

Posted by David North <dt...@corefiling.co.uk>.
Hi Markus,

This question would be best asked on the POI user list
(user@poi.apache.org) - moving thread there.

> is there a way to write the same file as xls and xlsx file ?
> For example with XSSF.

The APIs require you to pick one or the other - unfortunately although
the two share a set of common interfaces, we don't have code to clone
one implementation into the other.

> I tried writing a xlsx file with HSSF and it works.

That's surprising. Are you sure it's actually written an .xlsx file (a
ZIP with XML inside it)? Or is it the case that Excel happily opens an
.xls with the .xlsx extension?

> Can i use XSSF for XLS and XLSX without any problems?
> 
> Thanks a lot.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org