ColumnDef

class ColumnDef<T>(val header: String, val headerStyle: ExcelStyle? = null, val style: ExcelStyle? = null, val cellStyle: (T) -> ExcelStyle?? = null, val linkExtractor: (T) -> String?? = null, val valueExtractor: (T) -> Any?? = null, val formulaExtractor: (Int, T) -> String? = null)

Defines a column for the DataSheetScope.

Intentionally a plain class (not data class) because lambda fields cannot be meaningfully compared via equals()/hashCode().

Parameters

header

the column header text

headerStyle

optional style override for this column's header cell only

style

optional static style for data cells in this column

cellStyle

optional dynamic style for data cells, evaluated per item. Has the highest priority.

linkExtractor

optional lambda to extract a hyperlink URL from each item

valueExtractor

lambda to extract the cell value from each item

Constructors

Link copied to clipboard
constructor(header: String, headerStyle: ExcelStyle? = null, style: ExcelStyle? = null, cellStyle: (T) -> ExcelStyle?? = null, linkExtractor: (T) -> String?? = null, valueExtractor: (T) -> Any?? = null, formulaExtractor: (Int, T) -> String? = null)

Properties

Link copied to clipboard
val cellStyle: (T) -> ExcelStyle??
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val linkExtractor: (T) -> String??
Link copied to clipboard
Link copied to clipboard
val valueExtractor: (T) -> Any??