• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in sending csv data to browser.  RSS feed

 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When my servlet sends csv data to browser, IE opens the Excel and data is displayed in one cell. It does not recognize the comma ad the cell delimiter. The code is as follows:
res.setContentType("application/vnd.ms-excel");
out.println("11,22,33,44");
out.println("aa,bb,de,ee");
out.close();
The first row displays "11,22,33,44" in one cell. The second row displays "aa,bb,de,ee" in one cell.
What�s wrong?
Thanks.
 
Kripal Singh
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try
out.println("11\t22\t33\t44");
out.println("aa\tbb\tde\tee");
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
\t works!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!