Table of Contents

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

List<string>

this[int]

Returns the value of the row at the column index

public object this[int index] { get; }

Parameters

index int

the column index

Property Value

object

this[string]

Returns the value of the row at the column index

public object this[string columnName] { get; }

Parameters

columnName string

the column index

Property Value

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.

public void Automap<T>(T item) where T : class

Parameters

item T

The item to set the values on.

Type Parameters

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.

public string GetText(int index)

Parameters

index int

The 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

columnName string

The 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

index int

The column index

Returns

T

The value

Type Parameters

T

The 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

columnName string

The column name

Returns

T

The value

Type Parameters

T

The type to convert to

Exceptions

EPPlusDataTypeConvertionException

Returned if the data type conversion fails and ConversionFailureStrategy is set to Exception