Spreadsheet +
A comprehensive and fluent way to interact with spreadsheets with BoxLang
A powerful BoxLang module for creating, reading, and manipulating Excel spreadsheet files.
This module is only available to +/++ subscribers only but can be installed in conjunction with the bx-plus Module with a limited trial.
π― Three Ways to Work with Spreadsheets
The BoxLang Spreadsheet Module (bx-spreadsheet) offers three distinct APIs to suit different coding styles and migration scenarios:
Fluent API β¨
Spreadsheet()
β Recommended
Modern chainable interface for new code
BIF Functions π
SpreadsheetNew(), etc.
π CFML Compatibility
Migration from Adobe ColdFusion/Lucee
Component Tag π·οΈ
<bx:spreadsheet>
π CFML Compatibility
Legacy tag-based code migration
π‘ For new code, we strongly recommend using the Fluent API which provides better readability, maintainability, and modern method chaining.
β¨ Features
β¨ Fluent Method Chaining - Intuitive, readable code with chainable methods
π Multiple Formats - Support for
.xls(binary) and.xlsx(XML) formatsπ¨ Rich Formatting - Fonts, colors, borders, alignments, and cell styles
π’ Formula Support - Set, evaluate, and recalculate Excel formulas
π Data Import/Export - Convert to/from JSON, CSV, Query, and Array formats
πΌοΈ Image Embedding - Add images to spreadsheets with positioning control
π Password Protection - Secure spreadsheet files with passwords
π Multi-Sheet Support - Create, manage, copy, and manipulate multiple worksheets
π High Performance - Built on Apache POI for reliable, efficient processing
π§ Comprehensive API - 85+ BIF functions and full component support
π€ Automatic Resource Management - No need to manually close workbooks
βοΈ Freeze Panes - Lock rows/columns for better viewing
π Auto-sizing - Automatically adjust column widths
π Hyperlinks - Add and manage cell hyperlinks
π¬ Comments - Add cell comments with rich formatting
π Merge Cells - Combine cells for better layout
π Large File Streaming - Memory-efficient processing of large spreadsheets using Consumer callbacks
π Requirements
BoxLang Runtime 1.0.0 or higher
BoxLang+ License - This module requires a BoxLang+ license
π¦ Installation
Using CommandBox:
π Quick Start
Create Your First Spreadsheet (Fluent API)
Quick Examples
π Documentation
Getting Started
Quick StartUser GuideGuides
FormattingFormulasData ExportAdvanced FeaturesExamplesAPI Reference
Referenceπ Quick Reference
β¨ Fluent API (Recommended)
The modern, chainable interface for working with spreadsheets:
Complete Documentation: Fluent API Reference
π Built-in Functions (CFML Migration)
Traditional function-based approach for migrating from Adobe ColdFusion or Lucee:
Complete Documentation: BIF Reference
π·οΈ Component Tag (Legacy Migration)
Tag-based approach for migrating legacy CFML code:
Complete Documentation: Component Reference
π API Documentation
Complete JavaDoc API documentation with detailed method signatures, parameters, and return types:
π BoxLang Spreadsheet Module API Docs
π― Key Concepts
Fluent API Benefits
The Fluent API provides several advantages over traditional approaches:
Method Chaining - Chain operations for readable, maintainable code
Automatic Resource Management - No need to manually close workbooks
Modern Syntax - Clean, intuitive interface
Better IDE Support - Enhanced autocomplete and type hints
File Formats
.xlsx(XML Format) - Modern Excel format, default.xls(Binary Format) - Legacy Excel format for compatibility
Common Operations
Create new
Spreadsheet()
SpreadsheetNew()
Load file
Spreadsheet("file.xlsx")
SpreadsheetRead()
Set cell
.setCellValue(1, 1, "Value")
SpreadsheetSetCellValue()
Add row
.addRow(["A", "B"])
SpreadsheetAddRow()
Save
.save("file.xlsx")
SpreadsheetWrite()
Export
.toArray()
N/A
π‘ Migration Guide
From Adobe ColdFusion / Lucee
If you're migrating from ACF or Lucee:
Start with BIFs - Use the BIF Reference for drop-in compatibility
Gradually adopt Fluent API - Each BIF page shows the Fluent API equivalent
Update incrementally - No need to refactor everything at once
Example Migration:
Last updated
Was this helpful?
