This is my first ask on SO. Sorry if this has been answered in another question, but I haven't been able to find exactly what I need.
I'm have to use Apache POI 3.17 to generate a .xls report with some attached files (.doc and .ppt). Looking in other threads I have managed to generate the file without problems and add the attached files, but I would like to show its content into a frame instead as an object with an icon. Here is what i have:
POIFSFileSystem fs = new POIFSFileSystem(document.getDocument().getBinaryStream());
HSSFSheet tempSheet = workbook.createSheet(selectSheetName(usedNames, document.getDocumentName()));
int storageId = workbook.addOlePackage(fs, document.getDocumentName(), document.getDocumentName(), document.getDocumentName());
int picId = workbook.addPicture(getSamplePng(), HSSFPicture.PICTURE_TYPE_PNG);
HSSFPatriarch pat = tempSheet.createDrawingPatriarch();
HSSFClientAnchor anchor = pat.createAnchor(0, 0, 0, 0, 1, 2, 2, 6);
HSSFObjectData od = pat.createObjectData(anchor, storageId, picId);
od.setNoFill(true);
With that I create an icon that opens a word or PowerPoint when the user clicks it. And I want some like what you obtain when you use Insert->Object->Create From File Menu