Whatever message this page gives is out now! Go check it out!
SpreadSheetAddAutofilter(Spreadsheetobj, autofilter)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. The cell range must be in the form A1:J1. |
<cfscript>
/*Get data from table orders*/
ArtOrders=QueryExecute("SELECT orderid,customerfirstname,customerlastname,address,total,city FROM orders
ORDER BY orderid", [] ,{datasource="cfartgallery"});
/*Create spreadsheet object*/
myObj=SpreadSheetNew("Art");
SpreadSheetAddRow(myObj,"Order,First Name,Last Name,Address,Amount,City");
SpreadsheetFormatRow(myObj, {bold=TRUE, alignment="center",color="red"}, 1);
// Add rows to the spreadsheet
SpreadsheetAddRows(myObj,ArtOrders);
dirName=GetDirectoryFromPath(GetCurrentTemplatePath());
// Add auto filters from rows A1 to F1
SpreadSheetAddAutoFilter(myObj,"A1:F1");
SpreadsheetWrite(myObj,"#dirName#ArtOrders.xls",true);
</cfscript><cfscript>
/*Get data from table orders*/
ArtOrders=QueryExecute("SELECT orderid,customerfirstname,customerlastname,address,total,city FROM orders
ORDER BY orderid",[],{datasource="cfartgallery"});
/*Create spreadsheet*/
myObj=SpreadSheetNew("Art");
SpreadSheetAddRow(myObj,"Order,First Name,Last Name,Address,Amount,City");
SpreadsheetFormatRow(myObj, {bold=TRUE, alignment="center",color="red"}, 1);
SpreadsheetAddRows(myObj,ArtOrders);
dirName=GetDirectoryFromPath(GetCurrentTemplatePath());
myObj.autoAddFilter("A1:F1");
SpreadsheetWrite(myObj,"#dirName#ArtOrders.xls",true);
</cfscript>