Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JExcel API to create Excel sheet.

 
Nisha gowda
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a class for creating excel sheet using jexcel API.

As of now I am hard coding the path of excel sheet eg c:\sample.xls. And the excel sheet is getting generated in c drive.

My requirement is that I should only set the name of the excel sheet and when I execute the program it must popup the "file download" box which asks whether we want to save the file or open the file with selected program.


Could you please help me in enabling this feature?


Thanks,
Nisha
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a web app or a desktop app?
 
Nisha gowda
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web App
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'd use a Content-Disposition header; see http://faq.javaranch.com/java/JspAndExcel
 
Nisha gowda
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the info.. Can you please let me know how to enable same feature if it is desktop application? Its just for my knowledge
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just pop open a FileDialog or a JFileChooser and ask the user where she wants to save it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic