Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Export to Excel - Specify column datatype

Explorer ,
Dec 11, 2009 Dec 11, 2009

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

530
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 12, 2009 Dec 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Dec 14, 2009 Dec 14, 2009
LATEST

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


http://www.bennadel.com/projects/poi-utility.htm
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources