Server: CF10
Platform: Windows and Linux (Win in DEV windows in PROD)
So I'm generating this awesome excel file for a client but having trouble getting date fields to behave properly. Everything else seems to work just fine but when I send the data to excel to be generated, excel treats it as just text and when this filed gets sorted it handles it as such.
More info: The column I'm trying to configure is called Arrival Date it is arriving formatted as mm/dd/yyyy (I have tried to format is as m/d/yy but when it arrives in the sheet that doesn't work as well)
I'm also including an image of the sorted row. It does think its a valid but just doesn't sort it in chronological order.
Code:
<cfset filename = expandPath("./TDYData_(#DateFormat(now(),'mmddyy')#).xls")>
<!--- Make a spreadsheet object --->
<cfset s = spreadsheetNew("TDYData")>
<!--- Add header row --->
<cfset spreadsheetAddRow(s, "TDY Phase,Full Name,Employment Category,Gender,Originating Agency,Agency Comments,Originating Office,Office Comments,Originating Country,TDY Request Received,Mission Office Supported,Type of TDY Support,eCC Submission,eCC Approval,eCC Point of Contact,Date of Departure from Originating Country,Arrival Date,Departure Date,Accomodation Type,Accomodation Comments,Assigned Desk,Local Mobile Number,TDY Comments")>
<!--- format header --->
<cfset spreadsheetFormatRow(s,
{
bold=true,
fgcolor="lemon_chiffon",
fontsize=10
},
1)>
<!--- Add query --->
<cfset spreadsheetAddRows(s, myExcel)>
<cfset SpreadSheetAddFreezePane(s,0,1)>
<cfset spreadsheetFormatColumn(s, {dataformat="m/d/yy"}, 17) />
<cfset spreadsheetFormatColumn(s, {alignment="right"}, 16) />
<cfheader name="content-disposition" value="attachment; filename=TDY_Data_(#DateFormat(now(),'mmddyy')#).xls">
<cfcontent type="application/msexcel" variable="#spreadsheetReadBinary(s)#" reset="true">
Any ideas?
Thanks