문제

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?

도움이 되었습니까?

해결책

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 ) />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top