Fluent API
Complete reference for the SpreadsheetFile Fluent API - the recommended approach for working with spreadsheets in BoxLang
The Fluent API is the modern, recommended way to work with spreadsheets in BoxLang. It provides a chainable, intuitive interface centered around the SpreadsheetFile object.
Recommended Approach: The Fluent API is the preferred method for all spreadsheet operations. It's more intuitive, easier to read, and provides better code organization than traditional BIFs or component methods.
📋 Quick Navigation
Creating & Loading
Saving
save()
Saves the spreadsheet to the currently loaded path.
Arguments
None
Example
save( path )
Saves the spreadsheet to the specified path.
Arguments
path
String
Yes
Path where file should be saved
Example
save( path, password )
Saves the spreadsheet with password protection.
Arguments
path
String
Yes
Path where file should be saved
password
String
Yes
Password to protect the file
Example
saveAndClose()
Saves the spreadsheet and closes the workbook.
Arguments
None
Example
Sheet Management
Cell Operations
setCellValue( row, col, value )
Sets a cell value at the specified row and column.
Arguments
row
Integer
Yes
Row number (1-based)
col
Integer
Yes
Column number (1-based)
value
Any
Yes
Value to set (String, Number, Date, Boolean)
Example
getCellValue( row, col )
Gets a cell value at the specified row and column.
Arguments
row
Integer
Yes
Row number (1-based)
col
Integer
Yes
Column number (1-based)
Example
formatCell( row, col, format )
Formats a single cell.
Arguments
row
Integer
Yes
Row number (1-based)
col
Integer
Yes
Column number (1-based)
format
Struct
Yes
Formatting options (bold, italic, fontsize, fgcolor, etc.)
Example
Row Operations
Column Operations
Data Conversion
Formatting
formatCell( row, col, format )
Formats a cell with multiple style options.
Arguments
row
Integer
Yes
Row number (1-based)
col
Integer
Yes
Column number (1-based)
format
Struct
Yes
Style options
Format Options:
bold(Boolean) - Bold textitalic(Boolean) - Italic textunderline(Boolean) - Underline textfontsize(Integer) - Font size in pointsfont(String) - Font namefontColor(String) - Font colorfgcolor(String) - Background coloralignment(String) - Horizontal alignmentverticalalignment(String) - Vertical alignmentdataformat(String) - Number/date format
Example
Advanced Features
Large File Streaming
Information & Accessors
🔗 Method Chaining
Most Fluent API methods return the SpreadsheetFile object, enabling method chaining:
📚 See Also
Large File Streaming Guide - Memory-efficient processing
Quick Start Guide - Get started in 5 minutes
User Guide - Comprehensive usage guide
Examples - Real-world code samples
Built-In Functions - Traditional BIF reference
🔗 External Resources
Apache POI Documentation - Underlying library
Last updated
Was this helpful?
