Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

export data to excel and double byte

 
June
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read the postings about export data to excel.
I had this part done in English but when my data are in double byte, the data are not readable.
Anyone has any idea?
Thanks!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35753
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
June,
Are you using a comma/tab delimited file or an Excel library?
 
June
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,
All I did was getting the jsp page and view that page in excel. To do that, I just set content type to excel.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35753
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
June,
You are using what I consider a tab/comma separated file. The only thing I can think of is to make sure you set the proper encoding in the header.
 
June
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,
I set the content type to utf-8 for the jsp file already, but your suggestion confirms my thought that the header causes the problem too.
Will take a look at it again and may find out what was changed in the middle process.
Thanks
 
June
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I do response.setContentType("text/html; charset=UTF-8") before I filter the code to export to excel, it worked for double byte language but some single byte lang. don't work such as French.
My websphere server is on English machine and my applications can be viewed in different languages.
Anybody knows what is missing here?
Thanks!
 
June
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops copy/paste wrong line, the setting should be:
response.setContentType("application/vnd.ms-excel; charset=UTF-8");
It looks like if I set utf-8, the double byte lang. work and single byte doesn't work. If I don't set uft-8, the single byte works and double byte lang. doesn't work.
I don't know what is going on here.
Please help.
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!