• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in reading an embedded image from excel sheet using JXL

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic