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

Saving Query as xls file (I have searched and havent found this problem)

Community Beginner ,
Apr 24, 2007 Apr 24, 2007

Copy link to clipboard

Copied

I am trying to save a query as a xls file. The user can currently save the file to there desktop but excel warns them upon opening it that the file is associated with a different type of file do you want to continue. if you choose to continue then it will open up fine. so it kind of works. How can i get around this? i can't output it as a csv because there is comma's in some of the data i am outputting, and if i do a tab delimited then it is associated with notepad by default. here is my code:
thanks, Drew


TOPICS
Advanced techniques

Views

201

Translate

Translate

Report

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
Advocate ,
Apr 24, 2007 Apr 24, 2007

Copy link to clipboard

Copied

Try:
<cfcontent type="application/vnd.ms-excel">

instead of

<cfcontent type="application/msexcel">


Also, for future reference, you CAN create a CSV file whose elements contain commas if you qualify the offending fields with quotation marks:

Field 1, Field 2, "Field 3, and a comma", Field 4

Excel will be able to open those up just fine.

Votes

Translate

Translate

Report

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
Community Beginner ,
Apr 24, 2007 Apr 24, 2007

Copy link to clipboard

Copied

LATEST
i had tried changing the cf content before and it didnt make a difference, however using the "field1,field2" worked just perfect. thanks for the heads up.

Drew

Votes

Translate

Translate

Report

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
Documentation