• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ccomma delimited file

 
brisk rook
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i generate a comma delimted file in a loop for a jsp file & post it to the screen to allow the user to save this file in Excel..
 
Sam Dalton
Author
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set the content type to one appropriate type for excel
eg: response.setContentType("text/csv")

S
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or, do one better and actually feed the data straight into Excel, where the user can save it in the usual way. Instead of "text/csv", make your MIME type "application/x-msexcel". DON'T generate HTML, BTW, all you need to write are lines of comma-separated text, just like you would from a regular application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic