C# Класс 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.

Наследование: FileHelpers.DataLink.DataStorage
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
CellAsString ( object row, object col ) : string

Get the string value of a cell

Приватные методы

Метод Описание
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

Описание методов

CellAsString() защищенный Метод

Get the string value of a cell
protected CellAsString ( object row, object col ) : string
row object Cell Row
col object Cell Column
Результат string

ExcelNPOIStorage() публичный Метод

Create a new ExcelStorage to work with the specified type
public ExcelNPOIStorage ( Type recordType ) : System
recordType System.Type The type of records.
Результат System

ExcelNPOIStorage() публичный Метод

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.
Результат System

ExcelNPOIStorage() публичный Метод

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.
Результат System

ExtractRecords() публичный Метод

Returns the records extracted from Excel file.
public ExtractRecords ( ) : object[]
Результат object[]

InsertRecords() публичный Метод

Insert all the records in the specified Excel File.
public InsertRecords ( object records ) : void
records object The records to insert.
Результат void