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: Query about WorkbookFactory.create(input)
Date Thu, 29 Oct 2015 07:56:02 GMT
Hi,

WorkbookFactory can open both file formats and will use the correct
specific implementation internally automatically.

As long as you stick to the Workbook, Sheet, Row, Cell interfaces (in
contrast to XSSFWorkbook/HSSFWorkbook and related implementations),
you should be able to work with both types of files.

Functionality and behavior should be very similar for both types.
There may be some small differences in some areas when one format
supports things that the other does not.

Dominik.

On Thu, Oct 29, 2015 at 7:46 AM, Rohit Cha <rk661234567890@gmail.com> wrote:
> Does WorkbookFactory.create(input) can read both excel-2003 and excel-2007
> with out any exception or do we need to use xssf and hssf seperately for
> each one
>
>
> FileInputStream input = new FileInputStream(
>
> "/Users/Desktop/Spice+tool.xls");
>
>
> Workbook wb = WorkbookFactory.create(input);
>
> Sheet sheet = wb.getSheetAt(0);
>
> System.out.println(String.valueOf(sheet.getRow(11).getCell(0)));

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


Mime
View raw message