List of usage examples for org.apache.poi.hssf.converter AbstractExcelUtils loadXls
public static HSSFWorkbook loadXls(File xlsFile) throws IOException
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(); }