spreadsheetGetCellFormat

Returns the formatting of a single cell in the active sheet of a spreadsheet workbook as a struct with the same keys the format methods accept: bold, italic, fontsize, font, color, bgcolor, alignment, verticalalignment, wraptext and dataformat (number format code). Colours are returned as #RRGGBB hex strings. Keys are only present when the style sets them. Rows and columns are 1-based. The fluent member form is getCellFormat(row, column).

spreadsheetGetCellFormat(spreadsheetObj, row, column) → returns struct

This function requires RustCFML.  Not supported on Lucee, Adobe ColdFusion, etc.

Argument Reference

spreadsheetObj any
Required

The spreadsheet workbook object.

row numeric
Required

1-based row index of the cell.

column numeric
Required

1-based column index of the cell.

Compatibility

RustCFML:

Not supported on wasm32.

Examples
Sample code invoking the spreadsheetGetCellFormat function

Format a cell, then read the format struct back.

wb = Spreadsheet("xlsx");
spreadsheetFormatCell(wb, { bold: true, bgcolor: "#ffcc00", alignment: "center" }, 1, 1);
writeDump(spreadsheetGetCellFormat(wb, 1, 1));

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub