Discussion Area

ask questions, discuss topics, solve problems

This is a public Discussion Area  publicRSS

Thread

    • How to display chinese characters in excel when I...
      Thread posted May 21 by Hashmiji
      1291 Views, 2 Comments
      Title:
      How to display chinese characters in excel when I export from Coldfusion
      Content:
      Hi guys I am able to display chinese characters in a grid in html, but when i export the data to excel the chinese characters displays as question marks in excel. Database: Sql server Datatype: nvarchar Tried with charset = utf-8 & 16 while display but it still displays the same ???? This is my code: *******************************************************************************
      #replaceNoCase(replaceNoCase(columnHeading,"_"," ","all"),"Invoice","","all")#
      #dateFormat(evaluate("qInvoices.#columnHeading#"),"dd mmm yyyy")# #evaluate("qInvoices.#columnHeading#")#
      ******************************************************************************* I would seek ur valuable ideas to get this fixed. Thanks a lot ! Rgds Rafi
      Code Snippet:

    Comments

    • Hi Guys

      Happy to inform u guys that I got the issue fixed and the chinese characters are now displaying.

      The solution is, the <cfcontent ...tag though doesn't have a charset attribute u can embed it as a style of the type attribute. Like,

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

      and should be defined above the <cfheader ..tag.

      Please donot forget to send me a thanking mail.

      Cheers !!

      • posted Sep 23 by SebT

      Thanks for your post - I just had the same problem and your solution helped me. This is the way that is working for me:

      <cfheader name="Content-Disposition" value="attachment; filename=#downloadFilename#">
      <cfcontent type="application/vnd.ms-excel charset=utf-8">

      Cheers!