ColdFusion 9.0 Resources |
SpreadsheetShiftColumnsFunction syntaxSpreadsheetShiftColumns(spreadsheetObj, start[, cols] SpreadsheetShiftColumns(spreadsheetObj, start, end [, cols]) See alsoSpreadsheetAddColumn, SpreadsheetDeleteColumn, SpreadsheetDeleteColumns, SpreadsheetFormatColumn, SpreadsheetFormatColumns, SpreadsheetShiftRows Parameters
ExampleThe following line shifts columns 6 and 7 two columns to the left. <cfset SpreadsheetShiftColumns(SpreadsheetObj,l0,11,2)><cfscript> ///We need an absolute path, so get the current directory path. theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "shiftcolumns.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 E12",12,5); SpreadsheetSetCellValue(theSheet,"Cell F12",12,6); SpreadsheetSetCellValue(theSheet,"Cell G13",13,7); //Shift columns 6 and 7 left 2 columns. SpreadsheetShiftColumns(theSheet,6,7,-2); </cfscript> <!--- Write the spreadsheet to a file, replacing any existing file. ---> <cfspreadsheet action="write" filename="#theFile#" name="theSheet" overwrite=true> |