Skip to main content
Inspiring
February 16, 2011
Question

CFCONTENT Excel---Save Formulas

  • February 16, 2011
  • 2 replies
  • 952 views

I am using <cfcontent type="application/vnd.ms-excel"> tag.

It works well as it output the values to an excel spreadsheet.

My question is instead of outputting just the values can I output the values with the formulas that were used to calculate the values.

I need my users to be able to modify values in the spreadsheet and have it calcualte without them having to add the formulas themselves.

    This topic has been closed for replies.

    2 replies

    Community Expert
    February 17, 2011

    This wouldn't have anything to do with CF, really - if CSV supports formulas, you can put them in:

    http://www.mrexcel.com/forum/showthread.php?t=23274

    That said, I'd second Adam's recommendation to just use CFSPREADSHEET if that's an option.

    Dave Watts, CTO, Fig Leaf Software

    http://www.figleaf.com/

    http://training.figleaf.com/

    Dave Watts, Eidolon LLC
    Inspiring
    February 16, 2011

    I am using <cfcontent type="application/vnd.ms-excel"> tag.

    It works well as it output the values to an excel spreadsheet.

    All CFCONTENT does is to set the MIME type of the HTTP resonse which gets sent back tot he browser.  It doesn't in any way make the text that you stream down to the browser into an XLS file: it's still just text.  All it means is the browser - if configured to understand what "application/vnd.ms-excel" means - might suggest to the user that the returned data could be opened by Excel, rather than rendering it in the browser window.  And if Excel can interpret the returned text in a way that it can convert it to its own format... it will.

    However instead of horsing around with CFCONTENT and sending text to Excel... can't you use CFSPREADSHEET to create an actual XLS file?

    --

    Adam