Class ToCollectionRow
An object that represents a row in the callback function in ToCollectionWithMappings<T>(Func<ToCollectionRow, T>, ToCollectionRangeOptions)
Inheritance
Inherited Members
Namespace: OfficeOpenXml.Export.ToCollection
Assembly: EPPlus.dll
Syntax
public class ToCollectionRow
  Properties
Headers
Headers used to access cell values.
Declaration
public List<string> Headers { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Collections.Generic.List<System.String> | 
Item[Int32]
Returns the value of the row at the column index
Declaration
public object this[int index] { get; }
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | index | the column index  | 
      
Property Value
| Type | Description | 
|---|---|
| System.Object | 
Item[String]
Returns the value of the row at the column index
Declaration
public object this[string columnName] { get; }
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | columnName | the column index  | 
      
Property Value
| Type | Description | 
|---|---|
| System.Object | 
Methods
Automap<T>(T)
Maps properties on the item to values matching the column header with the property name or attibutes without white spaces. The attributes that can be used are: EpplusTableColumnAttributeBase.Header, DescriptionAttribute.Description or DisplayNameAttribute.Name.
Declaration
public void Automap<T>(T item)
    where T : class
  Parameters
| Type | Name | Description | 
|---|---|---|
| T | item | The item to set the values on.  | 
      
Type Parameters
| Name | Description | 
|---|---|
| T | The type used, must be a class  | 
      
GetText(Int32)
Returns formatted value of the cell at the column index within the row of the range.
Declaration
public string GetText(int index)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | index | The column index  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | The formatted value  | 
      
GetText(String)
Returns formatted value of the cell at the column index within the row of the range.
Declaration
public string GetText(string columnName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | columnName | The column name  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | The formatted value  | 
      
GetValue<T>(Int32)
Returns the typed value of the cell at the column index within the row of the range.
Declaration
public T GetValue<T>(int index)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | index | The column index  | 
      
Returns
| Type | Description | 
|---|---|
| T | The value  | 
      
Type Parameters
| Name | Description | 
|---|---|
| T | The type to convert to  | 
      
Exceptions
| Type | Condition | 
|---|---|
| EPPlusDataTypeConvertionException | Returned if the data type conversion fails and ConversionFailureStrategy is set to Exception  | 
      
GetValue<T>(String)
Returns the typed value of the cell at the column index within the row of the range.
Declaration
public T GetValue<T>(string columnName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | columnName | The column name  | 
      
Returns
| Type | Description | 
|---|---|
| T | The value  | 
      
Type Parameters
| Name | Description | 
|---|---|
| T | The type to convert to  | 
      
Exceptions
| Type | Condition | 
|---|---|
| EPPlusDataTypeConvertionException | Returned if the data type conversion fails and ConversionFailureStrategy is set to Exception  |