Skip to main content
Known Participant
December 11, 2009
Question

Export to Excel - Specify column datatype

  • December 11, 2009
  • 2 replies
  • 557 views

We have a process that is exporting a query to Excel. We're just using the old trick of creating an html table and using cfheader/cfcontent to spit it out as Excel. The problem is that the user wants to do a SUM on one of the columns, but by default the column type is "General" so the sum does not work. They have to convert the column datatype to "Number" and then SUM. Is there an easy way for me to specify that the value is a number when Im creating it in CF so Excel treats the data as a number instead of a string? And I know CF9 has cfspreadsheet. Not an option for me yet.

Thanks

    This topic has been closed for replies.

    2 replies

    Inspiring
    December 14, 2009

    You might try using Ben Nadel's POI Utility ColdFusion Component. 


    http://www.bennadel.com/projects/poi-utility.htm
    Inspiring
    December 12, 2009

    google "coldfusion excel export poi" and find Ben Nadel's cfc.  Use it instead of cfcontent.   Not only will it keep numbers as numbers, it will play nicer with Office 2007.