Thank you very much for the reply Mark :
Actually I had already tried getAllEmbedds().
( Nothing gets printed below ) L
FileInputStream fis = new FileInputStream(file);
XSSFWorkbook wb = new XSSFWorkbook(fis);
List<PackagePart> emb = wb.getAllEmbedds() ;
for( PackagePart pp : emb ){
System.out.println("ZZZ"+pp.getContentType());
}
Does it make any difference how the XSSFWorkbook object is instantiated. I
mean, am I using the wrong constructor. ?
( The way it is, I can read individual cell's contents. I just cant retrieve
them as individual tables. )
--sony
--- On Sun, 4/25/10, MSB <[email protected]> wrote:
> From: MSB <[email protected]>
> Subject: Re: Is it possible to read a table from Excel
> To: [email protected]
> Date: Sunday, April 25, 2010, 9:51 AM
>
> Take a look at this;
> http://poi.apache.org/apidocs/org/apache/poi/xssf/usermodel/XSSFWorkbook.html#getAllEmbedds%28%29
> because, as the tables are embedded, this is the most
> likely way to retrieve
> a reference to them.
>
> That method returns a List containing zero, one or more
> elements of type
> org.apache.poi.openxml4j.opc.PackagePart which you can then
> process using
> POI again - that is assuming they are all Excel workbooks.
> If you look at
> the constructor for the XSSFWorkbook class, you will see
> that one takes a
> reference to an OPCPackage object and it is possible to
> retrieve just such
> an object from the PackagePart by calling it's - that is
> the PackagePart(s)
> - getPackage() method.
>
> Have never tried it myself but I think that will work.
>
> Yours
>
> Mark B
>
>
>
> Sony Antony-3 wrote:
> >
> > Hello :
> > We have an excel workbook in the new XSSF format, with
> multiple embedded
> > tables.
> > When I do a Workbook.getNumberOfNames(), I get zero.
> >
> > Is it possible to read embedded tables using POI.
> >
> > Any help will be greatly appreciated.
> >
> > Thanks
> > --sony
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Is-it-possible-to-read-a-table-from-Excel-tp28356078p28356524.html
> Sent from the POI - User mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]