Description
A function to add auto filters to the spreadsheet.
Returns
Does not return a value.
Category
Microsoft Office Integration
Function syntax
SpreadSheetAddAutofilter(Spreadsheetobj, autofilter ) |
History
ColdFusion 11: Added the function.
Parameters
Parameter |
Description |
---|---|
spreadsheetObj |
The Excel spreadsheet object to which to add the column. |
autofilter |
The Excel filter that needs to be applied to the sheet. Note that the value should not contain spaces or invalid characters. |
Example
<cfset colList = "col1,col2,col3,col4,col5,col6,col7,col8,co9,col0"> <cfset rowCount = 100> <cfset qryObj = QueryNew("#colList#")> <cfset QueryAddRow(qryObj, #rowCount#)> <cfloop from="1" to="#rowCount#" index="r"> <cfloop from="1" to="#ListLen(colList)#" index="c"> <cfset QuerySetCell(qryObj, #ListGetAt(colList,c)#, "some random text r#r#c#c#", r)> </cfloop> </cfloop> <cfset xlObj =spreadsheetNew("testsheet", true)> <cfset spreadsheetAddRows(xlObj, "#qryObj#")> <cfset SpreadSheetAddAutofilter(xlObj, "E5:J50")> <cfset spreadsheetwrite(xlObj, "#Expandpath("./")#test_autofilter.xlsx", true)> |