This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JExcel API and Servlet - File upload

 
Karthik Krishnamurthy
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf. I'll look it up and post my findings also here.

Karthik
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic