excel
fun excel(output: OutputStream, driver: ExcelDriver = ExcelDriverFactory.autoDetect(), defaultStyle: ExcelStyle? = null, options: WorkbookOptions = WorkbookOptions(), init: WorkbookScope.() -> Unit)
Entry point for the Excel DSL.
Starts the Excel generation process. If an [engine] is not provided, it will be automatically detected based on the classpath dependencies.
// Auto-detect engine:
excel(response.outputStream) {
sheet("Inventory") { ... }
}
// Explicit engine:
excel(response.outputStream, driver = PoiDriver()) { ... }
Parameters
output
the stream to write the final Excel file
driver
the ExcelDriver implementation. Defaults to auto-detection.
default Style
optional global default style for the entire workbook
options
the WorkbookOptions configuration
init
the configuration block using WorkbookScope
See also
Throws
or its subclasses if generation fails