poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Stadler <dominik.stad...@gmx.at>
Subject Re: XSSF for XLS
Date Sun, 13 Nov 2016 17:02:39 GMT
Hi,

If you use HSSF to write to a file named ".xlsx" you likely actually write
it in .xls binary format, but Excel automatically detects this and opens it
anyway. Try unzipping the .xlsx to see if it is actually a
zipped-xml-format.

You can use the base interfaces from the "org.apache.poi.ss.usermodel"
package to do almost all things the same way for both formats, only the
creation of new files needs to use HSSFWorkbook and XSSFWorkbook
respectively, see e.g. the example at
http://poi.apache.org/spreadsheet/converting.html#New%2C+generic+SS+Usermodel+Code

And please use the poi-user-mailing-list instead of contacting people
directly.

Dominik.

On Sun, Nov 13, 2016 at 5:52 PM, Markus Maria Michaels <lolf1010@gmail.com>
wrote:

> Hey,
>
> sorry bothering you.
>
> Can i use XSSF to export both, XLS and XLSX files without any problems ?
>
> (I had no problem to export a XLSX - file with HSSF so far.)
>
> Thanks a lot.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message