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

cfprocessingdirective pageencoding also not working

Explorer ,
May 24, 2013 May 24, 2013

Copy link to clipboard

Copied

Hi

I use the below code to export the data from ldap query to excel

<cfheader name="Content-Disposition" value="attachment; filename=Report.xls">

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

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

But special characters appears as (?) symbol is excel sheet even though it displays correctly in browser

In Browser:

22.png

In Excel:

11.png

I even tried using <cfprocessingdirective pageencoding="utf-8" />

But still it appears same..

Pls advice

Views

1.2K

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
LEGEND ,
May 24, 2013 May 24, 2013

Copy link to clipboard

Copied

<cfprocessingdirective> is irrelevant here, as it only relates to the source code of the file being compiled, not any data being processed.

<meta> tags are browser instructions, and as you're specifically telling the browser not to deal with this response, that's not going to help either. Try setting the encoding as an HTTP header (so with <cfheader> rather than with a meta tag.

That said, if you want an XLS file, simply sending text and saying "it's XLS" is not a good approach. Use CF's XLS-creation functions or POI to crate an actual XLS file.

--

Adam

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 ,
May 26, 2013 May 26, 2013

Copy link to clipboard

Copied

can u pls elaborate little more on how to go about it ?

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
LEGEND ,
May 26, 2013 May 26, 2013

Copy link to clipboard

Copied

There are plenty of docs out there on how to use <cfheader> and CF's spreadsheet functions. I'm not gonna write your code for you. However if you write some code and have issues, and post back with a question, I'll keep an eye out for you.

CFHEADER:

http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7aea.html

Spreadsheet functions

http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec1a60c-7ffc.html#W...

<cfspreadsheet>

http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec17cba-7f87.html

Google:

https://www.google.co.uk/search?q=cfspreadsheet

--

Adam

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 ,
May 26, 2013 May 26, 2013

Copy link to clipboard

Copied

The following information is meant for the website developer for debugging purposes.                      
            Error Occurred While Processing Request                     

A tag starting with 'CF' has been detected. This tag is not supported by this version of ColdFusion.  Please verify your typo and try again.

            Unknown tag: cfspreadsheet.            

            ColdFusion cannot determine how to process the tag cfspreadsheet because the tag  is unknown and not in any imported tag libraries.  The tag name might be misspelled.

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
LEGEND ,
May 26, 2013 May 26, 2013

Copy link to clipboard

Copied

LATEST

Come on, help yourself a bit here. Just because you've asked for help on a forum doesn't mean you can then switch-off your brain and do no troubleshooting at all yourself.

Did you read the docs for <cfspreadsheet>? What version of CF was it added in? What version of CF are you running? Even the error message gives a very strong clue as to what the story is here:

This tag is not supported by this version of ColdFusion

So you're using CF8 or lower (if you're using an obsolete version of CF, you really ought to mention this in your initial post), so <cfspreadsheet> is not available to you.

So you'll need to use POI. Google it. Hint: Ben Nadel has written a CF wrapper for it.

--

Adam

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