ColdFusion 9.0 Resources |
SpreadsheetShiftRowsDescriptionShifts one or more rows in Excel spreadsheet object up or down. The contents of the shifted row, including empty cells, overwrites data in the column to which it is shifted. Function syntaxSpreadsheetShiftRows(spreadsheetObj, start[, rows] SpreadsheetShiftRows(spreadsheetObj, start, end, rows) See alsoSpreadsheetAddRow, SpreadsheetAddRows, SpreadsheetDeleteRow, SpreadsheetDeleteRows, SpreadsheetFormatRow, SpreadsheetFormatRows, SpreadsheetShiftColumns Parameters
ExampleThe following line shifts 10 and 11 down two rows. Notice that the shifted rows completely overwrite the previous rows 12 and 13. <cfscript> ///We need an absolute path, so get the current directory path. theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "shiftrows.xls"; //Create a new Excel spreadsheet object. theSheet = SpreadsheetNew("Expenses"); //Set some cell values, indicating their initial location. SpreadsheetSetCellValue(theSheet,"Cell D10",10,4); SpreadsheetSetCellValue(theSheet,"Cell E11",11,5); SpreadsheetSetCellValue(theSheet,"Cell A12",12,1); SpreadsheetSetCellValue(theSheet,"Cell B13",13,2); //Shift rows 10 and 11 down 2 rows. SpreadsheetShiftRows(theSheet,10,11,2); </cfscript> <!--- Write the spreadsheet to a file, replacing any existing file. ---> <cfspreadsheet action="write" filename="#theFile#" name="theSheet" overwrite=true> |