• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pass the name of the excel through servlet

 
Vanitha Pai
Greenhorn
Posts: 9
Eclipse IDE Java jQuery
  • Mark post as helpful
  • send pies
  • 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.
 
Tim Moores
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • 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
Eclipse IDE Java jQuery
  • Mark post as helpful
  • send pies
  • 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!
 
Archana Honnavalli
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • 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
Eclipse IDE Java jQuery
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic