rows

fun <T> rows(data: Sequence<T>, height: Double? = null, style: ExcelStyle? = null, init: RowScope.(T) -> Unit)

Creates rows from a Sequence for high-performance, memory-efficient streaming.

Ideal for processing large datasets from a database cursor or file.

// Example usage:
sheet("Sales") {
     rows(salesRepository.findAllAsSequence()) { sale ->
         cell(value = sale.id)
         cell(value = sale.amount)
     }
}

Parameters

data

the stream of data items to process

height

the optional height for each generated row

style

the optional style for each generated row

init

the DSL block to map a data item to row cells

Throws

if data processing violates sequential row order


fun <T> rows(data: Iterable<T>, height: Double? = null, style: ExcelStyle? = null, init: RowScope.(T) -> Unit)

Creates rows from an Iterable (e.g., List, Set).

Note: Internally converted to [Sequence] for processing.

See also