• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

writing output to an excel spreadsheet

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic