DataSheetScope

class DataSheetScope<T>(driver: ExcelDriver, defaultStyle: ExcelStyle? = null) : BaseScope

Scope for DTO-based data sheets. Provides a declarative way to map a collection of items to Excel rows.

Constructors

Link copied to clipboard
constructor(driver: ExcelDriver, defaultStyle: ExcelStyle? = null)

Functions

Link copied to clipboard
fun column(header: String, style: ExcelStyle? = null, headerStyle: ExcelStyle? = null, cellStyle: (T) -> ExcelStyle?? = null, link: (T) -> String?? = null, extractor: (T) -> Any?)

Defines a column in the data sheet.

Link copied to clipboard
fun columnFormula(header: String, style: ExcelStyle? = null, headerStyle: ExcelStyle? = null, cellStyle: (T) -> ExcelStyle?? = null, formula: (Int, T) -> String)

Defines a formula column in the data sheet.

Link copied to clipboard

Sets a style to be applied to the header row.

Link copied to clipboard
inline fun <R> nativeSheet(crossinline block: (R) -> Unit)

Provides access to the underlying native sheet object.

Link copied to clipboard
fun rowStyle(fn: (index: Int, item: T) -> ExcelStyle?)

Defines a conditional style for data rows.