GeeCON Prague 2014*
The moose likes JSP and the fly likes importing data from database to excel sheet through JExcel Api Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "importing data from database to excel sheet through JExcel Api" Watch "importing data from database to excel sheet through JExcel Api" New topic
Author

importing data from database to excel sheet through JExcel Api

akki gupta
Greenhorn

Joined: Nov 01, 2011
Posts: 9
Hey,
I want to import data from my database to Excel sheet through JSP using JExcel API.....but after creating a workbook using Workbook workbook=Workbook.createWorkbook(new File("myfile.xls")); it is not appearing in the working directory....I'm new to this.....Please help....
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

it is appearing in the working directory

if this is the problem then, to save this file under your desire directory just defined the path before the file name.





Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
akki gupta
Greenhorn

Joined: Nov 01, 2011
Posts: 9
sorry it was a typing mistake.....it's not present in the working directory.......
akki gupta
Greenhorn

Joined: Nov 01, 2011
Posts: 9
Is there some problem with the code???
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61305
    
  66

In a web application there is no such thing as a "working directory". You must explicitly place this file where you want it to go.

And, using a JSP for this type of processing is a really poor practice. Code such as this belongs in a JAva class, not a JSP (which, in 2011, should never have any Java code within it).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: importing data from database to excel sheet through JExcel Api