C# Class FileHelpers.ExcelNPOIStorage.ExcelNPOIStorage

This class implements the DataStorage for Microsoft Excel Files using the NPOI library.

WARNING you need to reference NPOI.dll in your project to use this feature.

To use this class you need to reference the FileHelpers.ExcelNPOIStorage.dll file.

Inheritance: FileHelpers.DataLink.DataStorage
Afficher le fichier Open project: MarcosMeli/FileHelpers Class Usage Examples

Méthodes publiques

Méthode Description
ExcelNPOIStorage ( Type recordType ) : System

Create a new ExcelStorage to work with the specified type

ExcelNPOIStorage ( Type recordType, int startRow, int startCol ) : System

Create a new ExcelStorage to work with the specified type

ExcelNPOIStorage ( Type recordType, string fileName, int startRow, int startCol ) : System

Create a new ExcelStorage to work with the specified type

ExtractRecords ( ) : object[]

Returns the records extracted from Excel file.

InsertRecords ( object records ) : void

Insert all the records in the specified Excel File.

Méthodes protégées

Méthode Description
CellAsString ( object row, object col ) : string

Get the string value of a cell

Private Methods

Méthode Description
AddHeaderColumns ( int startCol, int rowNum ) : void
CellAsString ( IRow row, int col ) : string
CloseAndCleanUp ( ) : void
ColumnsToValues ( object values ) : string
CreateWorkbook ( string filename ) : void
InitExcel ( ) : void
OpenOrCreateWorkbook ( string filename ) : void
OpenWorkbook ( string filename ) : void
RowValues ( int rowNum, int startCol, int numberOfCols ) : object[]
SaveWorkbook ( ) : void
SaveWorkbook ( string filename ) : void
WriteRowValues ( object values, int rowNum, int startCol ) : void

Method Details

CellAsString() protected méthode

Get the string value of a cell
protected CellAsString ( object row, object col ) : string
row object Cell Row
col object Cell Column
Résultat string

ExcelNPOIStorage() public méthode

Create a new ExcelStorage to work with the specified type
public ExcelNPOIStorage ( Type recordType ) : System
recordType System.Type The type of records.
Résultat System

ExcelNPOIStorage() public méthode

Create a new ExcelStorage to work with the specified type
public ExcelNPOIStorage ( Type recordType, int startRow, int startCol ) : System
recordType System.Type The type of records.
startRow int The row of the first data cell. Begining in 1.
startCol int The column of the first data cell. Begining in 1.
Résultat System

ExcelNPOIStorage() public méthode

Create a new ExcelStorage to work with the specified type
public ExcelNPOIStorage ( Type recordType, string fileName, int startRow, int startCol ) : System
recordType System.Type The type of records.
fileName string The file path to work with.
startRow int The row of the first data cell. Begining in 1.
startCol int The column of the first data cell. Begining in 1.
Résultat System

ExtractRecords() public méthode

Returns the records extracted from Excel file.
public ExtractRecords ( ) : object[]
Résultat object[]

InsertRecords() public méthode

Insert all the records in the specified Excel File.
public InsertRecords ( object records ) : void
records object The records to insert.
Résultat void