Generic Excel File (XLSX) Reader

com.myjeeva.poi
Class ExcelReader

java.lang.Object
  extended by com.myjeeva.poi.ExcelReader

public class ExcelReader
extends Object


Constructor Summary
ExcelReader(File file, XSSFSheetXMLHandler.SheetContentsHandler sheetContentsHandler, ExcelSheetCallback sheetCallback)
          Constructor: Microsoft Excel File (XSLX) Reader
ExcelReader(OPCPackage pkg, XSSFSheetXMLHandler.SheetContentsHandler sheetContentsHandler, ExcelSheetCallback sheetCallback)
          Constructor: Microsoft Excel File (XSLX) Reader
ExcelReader(String filePath, XSSFSheetXMLHandler.SheetContentsHandler sheetContentsHandler, ExcelSheetCallback sheetCallback)
          Constructor: Microsoft Excel File (XSLX) Reader
 
Method Summary
 void process()
          Processing all the WorkSheet from XLSX Workbook.
 void process(int sheetNumber)
          Processing of particular WorkSheet (zero based) from XLSX Workbook.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcelReader

public ExcelReader(OPCPackage pkg,
                   XSSFSheetXMLHandler.SheetContentsHandler sheetContentsHandler,
                   ExcelSheetCallback sheetCallback)
Constructor: Microsoft Excel File (XSLX) Reader

Parameters:
pkg - a OPCPackage object - The package to process XLSX
sheetContentsHandler - a XSSFSheetXMLHandler.SheetContentsHandler object - WorkSheet contents handler
sheetCallback - a ExcelSheetCallback object - WorkSheet callback for sheet processing begin and end (can be null)

ExcelReader

public ExcelReader(String filePath,
                   XSSFSheetXMLHandler.SheetContentsHandler sheetContentsHandler,
                   ExcelSheetCallback sheetCallback)
            throws Exception
Constructor: Microsoft Excel File (XSLX) Reader

Parameters:
filePath - a String object - The path of XLSX file
sheetContentsHandler - a XSSFSheetXMLHandler.SheetContentsHandler object - WorkSheet contents handler
sheetCallback - a ExcelSheetCallback object - WorkSheet callback for sheet processing begin and end (can be null)
Throws:
Exception

ExcelReader

public ExcelReader(File file,
                   XSSFSheetXMLHandler.SheetContentsHandler sheetContentsHandler,
                   ExcelSheetCallback sheetCallback)
            throws Exception
Constructor: Microsoft Excel File (XSLX) Reader

Parameters:
file - a File object - The File object of XLSX file
sheetContentsHandler - a XSSFSheetXMLHandler.SheetContentsHandler object - WorkSheet contents handler
sheetCallback - a ExcelSheetCallback object - WorkSheet callback for sheet processing begin and end (can be null)
Throws:
Exception
Method Detail

process

public void process()
             throws Exception
Processing all the WorkSheet from XLSX Workbook.

Example 1:
ExcelReader excelReader = new ExcelReader("src/main/resources/Sample-Person-Data.xlsx", workSheetHandler, sheetCallback);
excelReader.process();


Example 2:
ExcelReader excelReader = new ExcelReader(file, workSheetHandler, sheetCallback);
excelReader.process();


Example 3:
ExcelReader excelReader = new ExcelReader(pkg, workSheetHandler, sheetCallback);
excelReader.process();

Throws:
Exception

process

public void process(int sheetNumber)
             throws Exception
Processing of particular WorkSheet (zero based) from XLSX Workbook.

Example 1:
ExcelReader excelReader = new ExcelReader("src/main/resources/Sample-Person-Data.xlsx", workSheetHandler, sheetCallback);
excelReader.process(2);


Example 2:
ExcelReader excelReader = new ExcelReader(file, workSheetHandler, sheetCallback);
excelReader.process(2);


Example 3:
ExcelReader excelReader = new ExcelReader(pkg, workSheetHandler, sheetCallback);
excelReader.process(2);

Parameters:
sheetNumber - a int object
Throws:
Exception

Generic Excel File (XLSX) Reader

Copyright © myjeeva.com, All rights reserved.

The copyright of the pages and contents on this website is with myjeeva.com and the content is licensed under Creative Commons Attribution-Share Alike 3.0 Unported License. Libraries and code snippets on myjeeva.com has license information.