This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

writing output to an excel spreadsheet

 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
My servlet sets the content type to application/msexcel and writes to an excel spreadsheet, unfortunately when Excel comes up, it doesn't seem to recognize that my output is in csv format, so it puts all of the data per row in the first cell, for example, a row such as
1,2,3
doesn't get broken up into 3 cells, it is all put in the first cell as one string.
Any tips on how to get Excel to recoginze the comma seperators?
I am setting my content type using:
setContentType("application/vnd.ms-excel");
Thanks!
Kim
 
Markus Meier
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two other seperators, you can use:
tabs and semikolons.
But if you use a newer version of excel, you can generate a html-table and set the mime-type to "application/vnd.ms-excel".
this is the best way, because you can view it still in the browser ;)
greetings
Markus
 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much,
I wouldn't have thought changing from comma's to semicolons would do the trick but it did.
Thanks for your response,
Kim
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic