Skip to main content
Participating Frequently
November 6, 2008
Question

CFContent -- excel problem

  • November 6, 2008
  • 2 replies
  • 2394 views
Hello Everyone,
I am new to Coldfusion. I am trying to use the CFcontent tag to try to create an excel spreadsheet when a users clicks on a link. However, when I use the cfoutput tag, the excel window comes up to save, or open, but the file suffix .cfm instead of .xls. If I remove the cfoutput tags, the file suffix is .xls, but instead of listing the values, I get the field name in all cells -- ex. #hhkey# -- it does not replace the field name with the value. Could anyone assist me? Attached is the code:

    This topic has been closed for replies.

    2 replies

    Participating Frequently
    November 7, 2008
    thanks guys -- I will try these out to see what works
    Inspiring
    November 6, 2008
    Try swapping your cfcontent and cfheader tags so that cfcontent comes first. Like so...

    <cfcontent TYPE="application/vnd.ms-excel" reset="yes">
    <cfheader name="content-disposition" value="filename=TGSYC.xls">

    Participating Frequently
    November 7, 2008
    swapping the cfcontent and cfheader tags does not work either!!
    Help!!!