aspose file tools*
The moose likes Servlets and the fly likes writing output to an excel spreadsheet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "writing output to an excel spreadsheet" Watch "writing output to an excel spreadsheet" New topic
Author

writing output to an excel spreadsheet

Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
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

Joined: Aug 10, 2001
Posts: 2
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


-----<BR>...may the source be with you
Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: writing output to an excel spreadsheet
 
Similar Threads
Database output results to Excel
Redirecting to a generated excel file
PROJECT HELP USING SERVLETS
Writing an excel file to a ServletOutputStream
page caching