ExcelDriver

interface ExcelDriver

Strategy interface for interacting with different Excel libraries.

This interface abstracts the core operations of Excel generation, allowing the DSL to remain agnostic of the underlying engine (e.g., Apache POI, FastExcel).

Implementations must handle the lifecycle of workbooks, sheets, and rows in a streaming-compatible way.

Thread Safety: Implementations of this interface are generally not thread-safe. Synchronization should be handled at the DSL or application level.

See also

Inheritors

Functions

Link copied to clipboard
abstract fun applyOptions(options: WorkbookOptions)

Applies configuration options to the workbook.

Link copied to clipboard
abstract fun finishRow()

Finalize the current row.

Link copied to clipboard
abstract fun finishSheet()

Finalize the current sheet.

Link copied to clipboard
abstract fun finishWorkbook()

Finalize the workbook, write to the output stream, and release resources.

Link copied to clipboard
abstract fun mergeCells(firstRow: Int, lastRow: Int, firstCol: Int, lastCol: Int)

Merge a range of cells into one.

Link copied to clipboard
abstract fun nativeSheet(): Any?

Returns the currently active native sheet object.

Link copied to clipboard
abstract fun nativeWorkbook(): Any?

Returns the underlying native workbook object.

Link copied to clipboard
abstract fun setColumnWidth(col: Int, width: Int)

Set the width of a specific column.

Link copied to clipboard
abstract fun startRow(rowNum: Int, height: Double? = null)

Start a new row at the specified rowNum.

Link copied to clipboard
abstract fun startSheet(name: String)

Create a new sheet with the given name.

Link copied to clipboard
abstract fun startWorkbook(outputStream: OutputStream)

Initialize the workbook and associate it with the provided outputStream.

Link copied to clipboard
abstract fun writeCell(col: Int, value: Any?, style: ExcelStyle? = null, link: String? = null)

Write a value to a specific cell in the current row.

Link copied to clipboard
abstract fun writeFormula(col: Int, formula: String, style: ExcelStyle? = null)

Write a formula to a specific cell in the current row.