Example usage for org.apache.poi.hssf.converter AbstractExcelUtils loadXls

List of usage examples for org.apache.poi.hssf.converter AbstractExcelUtils loadXls

Introduction

In this page you can find the example usage for org.apache.poi.hssf.converter AbstractExcelUtils loadXls.

Prototype

public static HSSFWorkbook loadXls(File xlsFile) throws IOException 

Source Link

Usage

From source file:com.wangzhu.poi.ExcelToHtmlConverter.java

License:Apache License

/**
 * Converts Excel file (97-2007) into HTML file.
 * /*from   w  w w  .  ja v a2  s  .co m*/
 * @param xlsFile
 *            file to process
 * @return DOM representation of result HTML
 */
public static Document process(File xlsFile) throws Exception {
    final HSSFWorkbook workbook = AbstractExcelUtils.loadXls(xlsFile);
    ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter(
            DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument());
    excelToHtmlConverter.processWorkbook(workbook);
    return excelToHtmlConverter.getDocument();
}