Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

opening excel application in browser

 
khurram mirza
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does you data properly go into seperate columns? Mine won't.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic