use of org.apache.poi.xssf.binary.XSSFBSheetHandler in project poi by apache.
the class XSSFBEventBasedExcelExtractor method processSheet.
/**
* Processes the given sheet
*/
public void processSheet(SheetContentsHandler sheetContentsExtractor, XSSFBStylesTable styles, XSSFBCommentsTable comments, XSSFBSharedStringsTable strings, InputStream sheetInputStream) throws IOException, SAXException {
DataFormatter formatter;
if (getLocale() == null) {
formatter = new DataFormatter();
} else {
formatter = new DataFormatter(getLocale());
}
XSSFBSheetHandler xssfbSheetHandler = new XSSFBSheetHandler(sheetInputStream, styles, comments, strings, sheetContentsExtractor, formatter, getFormulasNotResults());
xssfbSheetHandler.parse();
}
use of org.apache.poi.xssf.binary.XSSFBSheetHandler in project poi by apache.
the class TestXSSFBReader method getSheets.
private List<String> getSheets(String testFileName) throws Exception {
OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream(testFileName));
List<String> sheetTexts = new ArrayList<String>();
XSSFBReader r = new XSSFBReader(pkg);
// assertNotNull(r.getWorkbookData());
// assertNotNull(r.getSharedStringsData());
assertNotNull(r.getXSSFBStylesTable());
XSSFBSharedStringsTable sst = new XSSFBSharedStringsTable(pkg);
XSSFBStylesTable xssfbStylesTable = r.getXSSFBStylesTable();
XSSFBReader.SheetIterator it = (XSSFBReader.SheetIterator) r.getSheetsData();
while (it.hasNext()) {
InputStream is = it.next();
String name = it.getSheetName();
TestSheetHandler testSheetHandler = new TestSheetHandler();
testSheetHandler.startSheet(name);
XSSFBSheetHandler sheetHandler = new XSSFBSheetHandler(is, xssfbStylesTable, it.getXSSFBSheetComments(), sst, testSheetHandler, new DataFormatter(), false);
sheetHandler.parse();
testSheetHandler.endSheet();
sheetTexts.add(testSheetHandler.toString());
}
return sheetTexts;
}
use of org.apache.poi.xssf.binary.XSSFBSheetHandler in project tika by apache.
the class XSSFBExcelExtractorDecorator method processSheet.
private void processSheet(SheetContentsHandler sheetContentsExtractor, XSSFBCommentsTable comments, XSSFBStylesTable styles, XSSFBSharedStringsTable strings, InputStream sheetInputStream) throws IOException, SAXException {
XSSFBSheetHandler xssfbSheetHandler = new XSSFBSheetHandler(sheetInputStream, styles, comments, strings, sheetContentsExtractor, formatter, false);
xssfbSheetHandler.parse();
}
Aggregations