public class ExcelFileHandler {
private static int SHEETMAXROWS = 60000;//can't not over 65536 rows
/**
* 根据文件路径读取excel
*
* @param file:导出文件名
* @param templateFile:导入的模板Excel文件
* @param sheetName:excel表的sheet名
* @return result:excel object
* @throws FileNotFoundException
*/
public HSSFWorkbook readExcelTemplate(String templateFile,
String sheetName) throws FileNotFoundException
{
FileInputStream template = new FileInputStream(templateFile);
return readExcelTemplate(template,sheetName );
}
/**
* 根据文件流读取excel
* @param inputStream
* @param sheetName
* @return
* @throws FileNotFoundException
*/
private static int SHEETMAXROWS = 60000;//can't not over 65536 rows
/**
* 根据文件路径读取excel
*
* @param file:导出文件名
* @param templateFile:导入的模板Excel文件
* @param sheetName:excel表的sheet名
* @return result:excel object
* @throws FileNotFoundException
*/
public HSSFWorkbook readExcelTemplate(String templateFile,
String sheetName) throws FileNotFoundException
{
FileInputStream template = new FileInputStream(templateFile);
return readExcelTemplate(template,sheetName );
}
/**
* 根据文件流读取excel
* @param inputStream
* @param sheetName
* @return
* @throws FileNotFoundException
*/