wood burning stoves 2.0*
The moose likes Servlets and the fly likes opening excel application in browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "opening excel application in browser" Watch "opening excel application in browser" New topic
Author

opening excel application in browser

khurram mirza
Greenhorn

Joined: Jun 10, 2001
Posts: 25
i'm trying to open the excel application in browser window using setContentType("application/vnd.ms-excel") and it works.But when i try to read an excel file from disk to browser, then excel applcation opens but its data (i.e. excel data) looks corrupted in browser window.the io stream i'm using for reading data is
new BufferedReader(new FileReader(filepath)).
please somebody help me about this problem as early as possible.
Joe Wolf
Ranch Hand

Joined: Jul 05, 2001
Posts: 42
I'm not sure what your "corruption" of data means exactly but if you're like me, it means that the file isn't formatted correctly...instead of putting data in seperate columns, it would just stick everything in one column, delimiters and all.
I may be wrong, but I have a strong belief that it's not BufferReader's fault but it's Excel's fault for not properly interpreting the delimiters in the input file. Unfortuntely, I don't know how to fix this problem yet.
khurram mirza
Greenhorn

Joined: Jun 10, 2001
Posts: 25
i'm khurram mirza.i solved my problem i was facing couple of days before.that is the excel data seems like garbage when opened in browser.the reason for that problem was that i was using wrong output stream (i.e PrintWriter object) for sending data to browser instead i should have used the ServletOutputStream obj for that purpose.it sends data in binary format to browser.
khurram mirza.
Joe Wolf
Ranch Hand

Joined: Jul 05, 2001
Posts: 42
Does you data properly go into seperate columns? Mine won't.
 
Don't get me started about those stupid light bulbs.
 
subject: opening excel application in browser
 
Similar Threads
Problem in opening multiple browser
Important jsp
Setting the column width of an Excel
OutOfMemoryError
display output table in excel file format