On 1/29/2012 7:25 AM, Mark Beardsley wrote:
Have you taken a look at the quick guide yet? There is an example that shows
how to extract embedded objects from an Excel sheet;
http://poi.apache.org/spreadsheet/quick-guide.html#Embedded
Admittedly, I wrote it a while back but the fact that it remains there does
suggest it may still be valid.
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/Extracting-a-byte-of-a-record-tp5437114p5439538.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]
Thanks for your suggestion. The following code from your example is
close to what I wrote, but leaves me with the same problem I had: How to
access the raw bytes of the item from a DocumentEntry. I've added a
comment to the code below to show my particular trouble area.
} else {
if (obj.hasDirectoryEntry()) {
// The DirectoryEntry is a DocumentNode.
Examine its
// entries to find out what it is
DirectoryNode dn = (DirectoryNode) obj
.getDirectory();
for (Iterator<Entry> entries =
dn.getEntries(); entries
.hasNext();) {
Entry entry = (Entry) entries.next();
if(entry.isDocumentEntry()) {
//How do I extract the object data
from this object?
System.out.println(oleName + "." +
entry.getName());
DocumentEntry docEntry =
(DocumentEntry)entry;
}
}
} else {
// There is no DirectoryEntry
// Recover the object's data from the
HSSFObjectData
// instance.
byte[] objectData = obj.getObjectData();
System.out.println(objectData);
}
Thanks,
Josh
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]