• 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

Pass the name of the excel through servlet

 
Greenhorn
Posts: 9
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a download functionality in my program that opens an excel sheet on click of a button on the JSP. How can I specify the name of the excel through servlet when the document opens? Also I want to give different names for the worsheets inside the excel sheet,how do I do that? Please help me in this since I have no idea about this.

Thanks in advance.
 
Saloon Keeper
Posts: 7582
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use a library like Apache POI to alter the sheet names before you stream the file to the client. Set the Content-Disposition response header for how to give a name to the file.
 
Vanitha Pai
Greenhorn
Posts: 9
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:You can use a library like Apache POI to alter the sheet names before you stream the file to the client. Set the Content-Disposition response header for how to give a name to the file.



Thanks a lot, that worked great!
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Apache POI works great for both xls and xlsx files.
I am using this jar to extract each cell value.

However cells with custom defined styles other than "General" will pose some challenges while extracting values. So be a lil careful.
 
Vanitha Pai
Greenhorn
Posts: 9
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Archana Honnavalli wrote:Yes Apache POI works great for both xls and xlsx files.
I am using this jar to extract each cell value.

However cells with custom defined styles other than "General" will pose some challenges while extracting values. So be a lil careful.



Hi Archana,

Thanks for mentioning that. However, I noticed this behaviour during the implementation.
 
reply
    Bookmark Topic Watch Topic
  • New Topic