Example usage for org.apache.poi.hssf.extractor ExcelExtractor setIncludeBlankCells

List of usage examples for org.apache.poi.hssf.extractor ExcelExtractor setIncludeBlankCells

Introduction

In this page you can find the example usage for org.apache.poi.hssf.extractor ExcelExtractor setIncludeBlankCells.

Prototype

public void setIncludeBlankCells(boolean includeBlankCells) 

Source Link

Document

Should blank cells be output?

Usage

From source file:com.bayareasoftware.chartengine.ds.util.ExcelDump.java

License:Apache License

private static void runNew(String fileName) throws Exception {
    InputStream inp = new FileInputStream(fileName);
    HSSFWorkbook wb = new HSSFWorkbook(new POIFSFileSystem(inp));
    ExcelExtractor xt = new ExcelExtractor(wb);

    xt.setFormulasNotResults(false);// w  w  w.  ja va 2 s  . co m
    xt.setIncludeBlankCells(true);
    xt.setIncludeSheetNames(false);
    String text = xt.getText();
    String[] lines = StringUtil.splitCompletely(text, '\n');
    for (int i = 0; i < lines.length; i++) {
        System.out.println((i + 1) + ") " + lines[i]);
    }
    System.out.println("XLS: \n" + text);
}