Class ToCollectionRow
An object that represents a row in the callback function in ToCollectionWithMappings<T>(Func<ToCollectionRow, T>, ToCollectionRangeOptions)
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 |
|---|---|
| List<string> |
this[int]
Returns the value of the row at the column index
Declaration
public object this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | the column index |
Property Value
| Type | Description |
|---|---|
| object |
this[string]
Returns the value of the row at the column index
Declaration
public object this[string columnName] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | columnName | the column index |
Property Value
| Type | Description |
|---|---|
| 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(int)
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 |
|---|---|---|
| int | index | The column index |
Returns
| Type | Description |
|---|---|
| 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 |
|---|---|---|
| string | columnName | The column name |
Returns
| Type | Description |
|---|---|
| string | The formatted value |
GetValue<T>(int)
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 |
|---|---|---|
| int | 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 |
|---|---|---|
| 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 |