• Post Reply Bookmark Topic Watch Topic
  • New Topic

excel download  RSS feed

 
Vandiyadevan senthan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I am having a data which is displaying in front end screen.
When i click a button the data has to be uploaded to excel file.
Can anyone did before.If so,Please let me know the code to perform that.
your help is highly appreciated.
Thanx in advance.
rds,
Vandiyadevan
 
sunitha reghu
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this
 
Bruno Dery
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't need fancy functions from Excel but just simply opening Excel directly from the file being downloaded, you can simply write a comma delimited file and it should open up with excel by default (if the user didnt changed his / her file associations, office sets .csv files associated with excel). So simply make sure you separate your columns by commas and your rows by newlines and name the file you output with the extension .csv.
 
Uwe Barthel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bruno Dery:
If you don't need fancy functions from Excel but just simply opening Excel directly from the file being downloaded, you can simply write a comma delimited file and it should open up with excel by default (if the user didnt changed his / her file associations, office sets .csv files associated with excel). So simply make sure you separate your columns by commas and your rows by newlines and name the file you output with the extension .csv.

yes, and add 'application/vnd.ms-excel' to 'Content-Type' in HTTP .
e.g.: <% response.setContentType( "application/vnd.ms-excel" ); %>
thx
Uwe Barthel
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!