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

ex

New Here ,
Jun 21, 2013 Jun 21, 2013

Copy link to clipboard

Copied

Hi,

I have the query results and try to dump it into csv or txt file but have troubled with data because lot of stuffs from description field.  Excel is the only solution but when i click on the excel link and click OK button,  i got this message below

"the file you are trying to open, excelReport.xls  is in a different format than specified by the file extension ......"

After clicking on Yes the file opens properly, but i don't want this msg to appear.

i have MX Excel 10 and coldusion 7, is there the way to get rid of message?

<cfcontent type="application/msexcel">

<cfheader name="Content-Disposition" value="filename=BrightIdea.xls">

<cfloop query="variables.qReport">

....

</cfloop>

Thanks

Views

622

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 Expert ,
Jun 22, 2013 Jun 22, 2013

Copy link to clipboard

Copied

What about this one:

<cfheader name="Content-Disposition" value="inline; filename=BrightIdea.xls">

<cfcontent type="application/vnd.msexcel">

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
Explorer ,
Jun 22, 2013 Jun 22, 2013

Copy link to clipboard

Copied

Sadly not as you're generating this file as a HTML file which Excel is able to interpret as a Excel File.

The only way I would suggest to upgrade to a supported version of ColdFusion like 9 or 10 and use CFSPREADSHEET this would be the best way to resolve the issue you have.

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 Expert ,
Jun 22, 2013 Jun 22, 2013

Copy link to clipboard

Copied

Big Mad Kev, you mean, to get rid of an annoying message, he should buy and install a new application server? Talk about the tail wagging the dog!

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
Explorer ,
Jun 22, 2013 Jun 22, 2013

Copy link to clipboard

Copied

I'm saying this isn't a ColdFusion issue it's how the data is rendered, what I am saying is that using a solution like CFSPREADSHEET will resolve the issue and keep it just as easy as ColdFusion has always done made hard things easy and in the latest supported versions they put effort in doing this for Excel documents.

He could also look at something like: http://www.bennadel.com/blog/461-Creating-Microsoft-Excel-Documents-With-ColdFusion-And-XML.htm which may be more involved then you need.

Or even: http://www.bennadel.com/blog/474-ColdFusion-Component-Wrapper-For-POI-To-Read-And-Write-Excel-Files....

Both these solutions will help him create native Excel Documents, if he is using Excel 2007+ then he can generate the XML files for the excel file and then zip it up with an extension of xlsx.

Just saying that ColdFusion 7 isn't a support platform and came out over 8 years ago in 2005 and so he wants to do things with the latest version of excel then use the latest version of the App Server or roll your own as above.

Just giving some guidance, but of course if that's wrong and I get burned for giving adivce I'll leave now.

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 Expert ,
Jun 22, 2013 Jun 22, 2013

Copy link to clipboard

Copied

LATEST

Sorry, it wasn't my intention to throw fire in your direction. There are certainly good points in your suggestion. We only differ in point of view.

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