Reputation: 83173
I'm using cfspreadsheet to generate an excel spreadsheet. I'm adding rows one by one. Immediately after I add the row, I want to format it. Something like this:
<cfset SpreadsheetAddRow(mySpreadsheet, "hi,this,is,a,test") />
<cfset SpreadsheetFormatRow(mySpreadsheet,
{
fgcolor:red;
}) />
However, for the formatrow function, you have to provide a row number. Is there any way to format the row I just added without keeping a running counter of what row I'm up to?
Upvotes: 1
Views: 417
Reputation: 1964
The spreadsheet object itself knows how many rows are in it, similar to a query object.
<cfset CurrentRow = mySpreadsheet.RowCount />
Updating your example so that it works in ACF9:
<cfset SpreadsheetFormatRow(mySpreadsheet,
{
fgcolor = 'red'
}, mySpreadSheet.RowCount ) />
Upvotes: 5