• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

JExcel API and Servlet - File upload

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf. I'll look it up and post my findings also here.

Karthik
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic