You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Prajnananda Tripathy, Noida" <pr...@noida.hcltech.com> on 2003/10/10 09:58:57 UTC

Not able to retrieve the Viewable array

hi everybody
   Thanks .
   I am new in using the POIFS 
   I am using jakarta-poi-1.5.1-final. I am still not able to trace how to
read the values in the cells of Microsoft     document.Pl let me know the
procedure mentioned below of reading the cell is correct or not?

     InputStream stream = new FileInputStream("doc.xls");
     fs = new POIFSFileSystem(stream);
     DirectoryEntry directory = fs.getRoot();
     DocumentEntry document=null;
     for (Iterator iter = directory.getEntries(); iter.hasNext(); )
     {
      Entry entry = (Entry)iter.next();
      if (entry instanceof DirectoryEntry)
      {
          // .. recurse into this directory
      }
      else if (entry instanceof DocumentEntry)
      {
        document=(DocumentEntry)entry;
        DocumentInputStream docStream = new DocumentInputStream(document);
        int available = docStream.available();
        byte[] content = new byte[ docStream.available() ];
        docStream.read(content);
        if (entry instanceof DocumentNode)
        {
           DocumentNode docNode= (DocumentNode)entry;
           System.out.println("DocumentNode :"+docNode);
           nodeSize= docNode.getSize();
           Object[] arrayObj= docNode.getViewableArray();
        }
   If the arrayobj is instance of Property. Then information can be
retrieved using the API's of Property class. 

Best Regards,
Prajnananda




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