Skip to content
sheetsmith

Configuration properties

All properties use the prefix sheetsmith. They are bound to the immutable record SheetsmithProperties and come with metadata for IDE auto-completion.

Property Type Default Meaning Constraint
sheetsmith.formats.date String yyyy-mm-dd Default Excel format of date cells, such as LocalDate values. not blank
sheetsmith.formats.date-time String yyyy-mm-dd hh:mm:ss Default Excel format of date-time cells, such as LocalDateTime values. not blank
sheetsmith.formats.number String empty (Excel “General”) Default Excel format of numeric cells, integers included. may be empty
sheetsmith.preset TablePreset NONE Preset of sheet classes that declare preset = INHERIT: NONE, LIGHT, MEDIUM, DARK. not INHERIT
sheetsmith.accent-color String #4472C4 Accent colour of sheet classes that declare none: #RRGGBB or an IndexedColors name. valid colour
sheetsmith.document.author String sheetsmith Author recorded in every file. Empty leaves it out. none
sheetsmith.document.application String sheetsmith Application recorded in every file. Empty leaves it out. none
sheetsmith.validation.packages list of String empty Packages scanned at startup, subpackages included. Empty disables the startup validation. none

Notes:

  • Excel syntax. Formats use the Excel format syntax (section 6.6), not DateTimeFormatter syntax: mm is the month, or the minutes after an hour code.
  • YAML and #. In YAML, quote every value that starts with #, otherwise it is read as a comment: accent-color: "#1F4E79", number: "#,##0.00".
  • Invalid values stop the application at startup: sheetsmith.preset=INHERIT, a blank date or date-time format, an invalid accent colour (IllegalArgumentException from SheetsmithDefaults), or a value that is not a preset name (Spring binding error).
  • Relaxed binding. Standard Spring Boot relaxed binding applies: enum values can be written in lower case (light), and environment variables use the usual form (SHEETSMITH_PRESET, SHEETSMITH_ACCENT_COLOR, SHEETSMITH_FORMATS_DATE_TIME, SHEETSMITH_DOCUMENT_AUTHOR, SHEETSMITH_VALIDATION_PACKAGES=com.example.export,com.example.reports).

application.yml:

sheetsmith:
formats:
date: dd/mm/yyyy
date-time: dd/mm/yyyy hh:mm
number: "#,##0.00"
preset: LIGHT
accent-color: "#1F4E79"
document:
author: Example Ltd
application: Billing
validation:
packages:
- com.example.export
- com.example.reports

application.properties:

sheetsmith.formats.date=dd/mm/yyyy
sheetsmith.formats.date-time=dd/mm/yyyy hh:mm
sheetsmith.formats.number=#,##0.00
sheetsmith.preset=LIGHT
sheetsmith.accent-color=#1F4E79
sheetsmith.document.author=Example Ltd
sheetsmith.document.application=Billing
sheetsmith.validation.packages=com.example.export,com.example.reports

In .properties files # starts a comment only at the beginning of a line, so values containing # need no quoting.