SheetTextExtractor sheetExtractor = new SheetTextExtractor(); XSSFBHyperlinksTable hyperlinksTable = null; while (iter.hasNext()) { InputStream stream = iter.next(); if (getIncludeSheetNames()) { text.append(iter.getSheetName()); text.append('\n'); hyperlinksTable = new XSSFBHyperlinksTable(iter.getSheetPart()); XSSFBCommentsTable comments = getIncludeCellComments() ? iter.getXSSFBSheetComments() : null; processSheet(sheetExtractor, styles, comments, strings, stream); if (getIncludeHeadersFooters()) { processShapes(iter.getShapes(), text);
while (iter.hasNext()) { InputStream stream = iter.next(); PackagePart sheetPart = iter.getSheetPart(); addDrawingHyperLinks(sheetPart); sheetParts.add(sheetPart); XSSFBCommentsTable comments = iter.getXSSFBSheetComments(); xhtml.element("h1", iter.getSheetName()); extractHeaderFooter(footer, xhtml); List<XSSFShape> shapes = iter.getShapes();
SheetTextExtractor sheetExtractor = new SheetTextExtractor(); XSSFBHyperlinksTable hyperlinksTable = null; while (iter.hasNext()) { InputStream stream = iter.next(); if (getIncludeSheetNames()) { text.append(iter.getSheetName()); text.append('\n'); hyperlinksTable = new XSSFBHyperlinksTable(iter.getSheetPart()); XSSFBCommentsTable comments = getIncludeCellComments() ? iter.getXSSFBSheetComments() : null; processSheet(sheetExtractor, styles, comments, strings, stream); if (getIncludeHeadersFooters()) { processShapes(iter.getShapes(), text);
public XSSFBCommentsTable getXSSFBSheetComments() { PackagePart sheetPkg = getSheetPart(); // Do we have a comments relationship? (Only ever one if so) try { PackageRelationshipCollection commentsList = sheetPkg.getRelationshipsByType(XSSFRelation.SHEET_COMMENTS.getRelation()); if (commentsList.size() > 0) { PackageRelationship comments = commentsList.getRelationship(0); if (comments == null || comments.getTargetURI() == null) { return null; } PackagePartName commentsName = PackagingURIHelper.createPartName(comments.getTargetURI()); PackagePart commentsPart = sheetPkg.getPackage().getPart(commentsName); return new XSSFBCommentsTable(commentsPart.getInputStream()); } } catch (InvalidFormatException | IOException e) { return null; } return null; }
/** * Returns an Iterator which will let you get at all the * different Sheets in turn. * Each sheet's InputStream is only opened when fetched * from the Iterator. It's up to you to close the * InputStreams when done with each one. */ @Override public Iterator<InputStream> getSheetsData() throws IOException, InvalidFormatException { return new SheetIterator(workbookPart); }
while (iter.hasNext()) { InputStream stream = iter.next(); PackagePart sheetPart = iter.getSheetPart(); addDrawingHyperLinks(sheetPart); sheetParts.add(sheetPart); XSSFBCommentsTable comments = iter.getXSSFBSheetComments(); xhtml.element("h1", iter.getSheetName()); extractHeaderFooter(footer, xhtml); List<XSSFShape> shapes = iter.getShapes();
public XSSFBCommentsTable getXSSFBSheetComments() { PackagePart sheetPkg = getSheetPart(); // Do we have a comments relationship? (Only ever one if so) try { PackageRelationshipCollection commentsList = sheetPkg.getRelationshipsByType(XSSFRelation.SHEET_COMMENTS.getRelation()); if (commentsList.size() > 0) { PackageRelationship comments = commentsList.getRelationship(0); if (comments == null || comments.getTargetURI() == null) { return null; } PackagePartName commentsName = PackagingURIHelper.createPartName(comments.getTargetURI()); PackagePart commentsPart = sheetPkg.getPackage().getPart(commentsName); return new XSSFBCommentsTable(commentsPart.getInputStream()); } } catch (InvalidFormatException | IOException e) { return null; } return null; }
/** * Returns an Iterator which will let you get at all the * different Sheets in turn. * Each sheet's InputStream is only opened when fetched * from the Iterator. It's up to you to close the * InputStreams when done with each one. */ @Override public Iterator<InputStream> getSheetsData() throws IOException, InvalidFormatException { return new SheetIterator(workbookPart); }