• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Export to excel functionality

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

I have built a html table dynamically from javascript function and I have exported this table content to a excel spread sheet onclick of a link in xhtml page.Problem I have here is,I dont find download popup with options like open,save or cancel before excel export and the table is getting exported to a excel sheet directly.Can anyone of you tell me,how to add this download popup?

Note:I am not sending this html table content to a servlet and I am doing all the processing at the client side.
 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
As far as I understand you will need to do the following when user clicks on "Export" button -
1) Invoke a servlet that would write CSV format data on the response
2) Set the content-type to MS-Excel (please check the exact content-type to be set)

For #1, you also use APACHE POI apis to generate the excel spreadsheet at server side and write it onto the Response stream.

Regards,
Amit
 
Ammu Chandran
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amit,
Since my project uses AJAX,I have made async request to a servlet and from the servlet I have built the html table by iterating the result set and appended it to a string builder and set the content type to application/vnd.ms-excel.But I am not getting any output for it.
Please help me to proceed further....

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic