This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes JExcel API and Servlet - File upload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "JExcel API and Servlet - File upload" Watch "JExcel API and Servlet - File upload" New topic
Author

JExcel API and Servlet - File upload

Karthik Krishnamurthy
Ranch Hand

Joined: Feb 04, 2005
Posts: 118
Hi,
I am using JExcel API to read in an excel file on upload. I had originally written it so that the uploaded .xls file is stored locally and then read.
Now, the requirement has changed and I have to read it from a stream. Is there some way to use the JExcel API to do this? The com.oreilly servlet example that I got off google reads it line by line on the request and I would probably have to rewrite my whole code if it has to be done like that.

I have two sheets that I have to read from.
Sample code:
workbook = Workbook.getWorkbook(file);
Sheet1 = workbook.getSheet(0);
sheet2 =workbook.getSheet(1)

The i read sheet by sheet for the data.

Any help greatly appreciated

Thanks
Karthik
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
The Workbook class has a getWorkbook(InputStream) method. That sounds like it might do the trick if you somehow can get the InputStream.
Karthik Krishnamurthy
Ranch Hand

Joined: Feb 04, 2005
Posts: 118
Thanks Ulf. I'll look it up and post my findings also here.

Karthik
 
wood burning stoves
 
subject: JExcel API and Servlet - File upload
 
It's not a secret anymore!