Class ToCollectionRow
- Namespace
- OfficeOpenXml.Export.ToCollection
- Assembly
- EPPlus.dll
An object that represents a row in the callback function in ToCollectionWithMappings<T>(Func<ToCollectionRow, T>, ToCollectionRangeOptions)
public class ToCollectionRow
- Inheritance
-
ToCollectionRow
- Inherited Members
Properties
Headers
Headers used to access cell values.
public List<string> Headers { get; }
Property Value
this[int]
Returns the value of the row at the column index
public object this[int index] { get; }
Parameters
indexintthe column index
Property Value
this[string]
Returns the value of the row at the column index
public object this[string columnName] { get; }
Parameters
columnNamestringthe column index
Property Value
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.
public void Automap<T>(T item) where T : class
Parameters
itemTThe item to set the values on.
Type Parameters
TThe type used, must be a class
GetText(int)
Returns formatted value of the cell at the column index within the row of the range.
public string GetText(int index)
Parameters
indexintThe column index
Returns
- string
The formatted value
GetText(string)
Returns formatted value of the cell at the column index within the row of the range.
public string GetText(string columnName)
Parameters
columnNamestringThe column name
Returns
- string
The formatted value
GetValue<T>(int)
Returns the typed value of the cell at the column index within the row of the range.
public T GetValue<T>(int index)
Parameters
indexintThe column index
Returns
- T
The value
Type Parameters
TThe type to convert to
Exceptions
- 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.
public T GetValue<T>(string columnName)
Parameters
columnNamestringThe column name
Returns
- T
The value
Type Parameters
TThe type to convert to
Exceptions
- EPPlusDataTypeConvertionException
Returned if the data type conversion fails and ConversionFailureStrategy is set to Exception