C# Class Smrf.AppLib.ExcelTableReader

Reads rows from an Excel table.
Use GetRows to iterate the rows of an Excel table. Filtered rows are automatically skipped, and the rows are buffered internally to eliminate having to make a slow COM interop call to get each row.

A collection of the column names in the table is available via the property.

Note that although this class is optimized for reading a table, the property allows you to write to the cells in a row as well. However, each such write operation incurs the overhead of a COM call, so this class should not be used when there are hundreds of cells that need to be written to.

Inheritance: Object
Afficher le fichier Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Свойство Type Description
m_aoCurrentSubrangeValues ].Object[
m_iCurrentRowOneBased System.Int32
m_oColumnIndexesOneBased Int32>.Dictionary
m_oCurrentSubrange Range
m_oTable ListObject

Méthodes publiques

Méthode Description
ExcelTableReader ( ListObject table ) : System

Initializes a new instance of the ExcelTableReader class.

If table has hidden columns, an exception is thrown. Use the ExcelColumnHider class to temporarily show all hidden columns if necessary.

GetRows ( ) : IEnumerable

Méthodes protégées

Méthode Description
GetRangeForCellInCurrentRow ( String sColumnName ) : Range
TryGetDoubleFromCellInCurrentRow ( String sColumnName, Double &dDouble ) : System.Boolean
TryGetInt32FromCellInCurrentRow ( String sColumnName, Int32 &iInt32 ) : System.Boolean
TryGetNonEmptyStringFromCellInCurrentRow ( String sColumnName, String &sNonEmptyString ) : System.Boolean

Private Methods

Méthode Description
AssertValid ( ) : void

Method Details

ExcelTableReader() public méthode

Initializes a new instance of the ExcelTableReader class.
If table has hidden columns, an exception is thrown. Use the ExcelColumnHider class to temporarily show all hidden columns if necessary.
public ExcelTableReader ( ListObject table ) : System
table ListObject /// The table to read. The table must have no hidden columns. ///
Résultat System

GetRangeForCellInCurrentRow() protected méthode

protected GetRangeForCellInCurrentRow ( String sColumnName ) : Range
sColumnName String
Résultat Range

GetRows() public méthode

public GetRows ( ) : IEnumerable
Résultat IEnumerable

TryGetDoubleFromCellInCurrentRow() protected méthode

protected TryGetDoubleFromCellInCurrentRow ( String sColumnName, Double &dDouble ) : System.Boolean
sColumnName String
dDouble Double
Résultat System.Boolean

TryGetInt32FromCellInCurrentRow() protected méthode

protected TryGetInt32FromCellInCurrentRow ( String sColumnName, Int32 &iInt32 ) : System.Boolean
sColumnName String
iInt32 System.Int32
Résultat System.Boolean

TryGetNonEmptyStringFromCellInCurrentRow() protected méthode

protected TryGetNonEmptyStringFromCellInCurrentRow ( String sColumnName, String &sNonEmptyString ) : System.Boolean
sColumnName String
sNonEmptyString String
Résultat System.Boolean

Property Details

m_aoCurrentSubrangeValues protected_oe property

protected Object[,] m_aoCurrentSubrangeValues
Résultat ].Object[

m_iCurrentRowOneBased protected_oe property

protected Int32,System m_iCurrentRowOneBased
Résultat System.Int32

m_oColumnIndexesOneBased protected_oe property

protected Dictionary m_oColumnIndexesOneBased
Résultat Int32>.Dictionary

m_oCurrentSubrange protected_oe property

protected Range m_oCurrentSubrange
Résultat Range

m_oTable protected_oe property

protected ListObject m_oTable
Résultat ListObject