This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes problem in reading an embedded image from excel sheet using JXL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "problem in reading an embedded image from excel sheet using JXL" Watch "problem in reading an embedded image from excel sheet using JXL" New topic
Author

problem in reading an embedded image from excel sheet using JXL

Sebi Peter
Greenhorn

Joined: Aug 04, 2005
Posts: 1
Hi everybody,

I was facing one problem in reading an image and putting into the database as a blob from excel sheet.If I copy the image and place it on the cell then the code I have written down works fine..
But now the problem is the image is embedded in the excel sheet so I�m not able to read this When I�m reading this some junk value is read into the database.So if any body has some suggestions just help me out..

I�m writing the code which I have used.. and I�m not able to attach the the excel sheetBut just to let u know it uses =EMBED("MSPhotoEd.3","") in the formula bar
the code written down does not work fine for images which are embedded

I�m using jxl

import jxl.Cell;
import jxl.Image;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;

// reading the drawing

Image img = sheet.getDrawing(0);

// putting it in byte array
byte[] imageData = img.getImageData();

// inserting into database blob object

prepareStatement.setBytes(1, imageData);

if any body can come with some suggestions about how can i do it.It will be quite helpful
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in reading an embedded image from excel sheet using JXL
 
Similar Threads
jxl package doenot exists
jxl getworkbook method hangs for corrupted file
Facing problem in loading embadded image from xls sheet into oracle database
jxl getworkbook method hangs for corrupted file
Inserting Image into Oracle.