CFHeader - appending date to xls file name

2009-03-25 Thread cfcom

I want to add the DATE to my file name in cfheader but it did not work.
Any suggestions

cfcontent type=application/msexcel
cfquery datasource=dsn 
   name=foobar
SELECT * FROM blasts 
ORDER BY memberid
/cfquery
cfset TheDate = Now()
cfheader name=Content-Disposition
value=filename=ResolveIT_Listcfoutput#Now()#/cfoutput.xls
table
cfoutput query=foobar
  tr
  td#FirstName#/td
  td#LastName#/td
  td#Email#/td
  td#Address1#/td
  td#City#/td
  td#State#/td
  td#Zip#/td
  /tr
/cfoutput

cfheader name=Content-Disposition
value=filename=MyFilescfoutput#DateFormat(TheDate,
'mm-dd-yy')#/cfoutput.xls


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320931
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Solved:---- CFHeader - appending date to xls file name

2009-03-25 Thread cfcom

Thanks all solved!




~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320935
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CFHeader - appending date to xls file name

2009-03-25 Thread Dave Watts

 cfheader name=Content-Disposition
 value=filename=ResolveIT_Listcfoutput#Now()#/cfoutput.xls
 table
 cfoutput query=foobar
  tr
  td#FirstName#/td
  td#LastName#/td
  td#Email#/td
  td#Address1#/td
  td#City#/td
  td#State#/td
  td#Zip#/td
  /tr
 /cfoutput

 cfheader name=Content-Disposition
 value=filename=MyFilescfoutput#DateFormat(TheDate,
 'mm-dd-yy')#/cfoutput.xls

First, you can't embed one CFML tag within another. If an attribute
value of a CFML tag contains an expression wrapped in hashes, it will
automatically output to the string used for the attribute value.

Bad: cfset myvar = something cfoutput#foo#/cfoutput something
Good: cfset myvar = something #foo# something

Second, you can't specify multiple Content-Distribution headers within
the same document. I'm not sure if that's what you're doing, but you
do have two of them in your code sample.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more inf

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320939
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4