File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes How to insert images in excel using jxl API 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 "How to insert images in excel using jxl API" Watch "How to insert images in excel using jxl API" New topic
Author

How to insert images in excel using jxl API

Manikanta Mogalluri
Greenhorn

Joined: Dec 31, 2008
Posts: 11
Hi All,

Could you please help me to insert images in excel workbook using jxl API.

Kindly give me any sample code.


With warm regards, Manikanta Mogalluri
SCJP(90%), SCWCD(100%)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
The jxl.write.WritableSheet class has the addImage method for that. Note that only PNG images are supported. If you have a JPEG, GIF or BMP you can use the javax.imageio.ImageIO class to convert them to PNG.


Ping & DNS - updated with new look and Ping home screen widget
Manikanta Mogalluri
Greenhorn

Joined: Dec 31, 2008
Posts: 11
Hi Ulf,

Thanks for giving the method.

It will be very useful if give me the sample code for this issue.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Search for "jexcelapi faq", it has an example.
shareeef hiasat
Greenhorn

Joined: Aug 27, 2013
Posts: 1
This code i used and worked but i faced little problems with sizing the image

As you see you must convert to PNG because its the only one supported

As if you worndered about if you can put it in some cell you cant stackoverflow inserting image into cell jxl


;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to insert images in excel using jxl API
 
Similar Threads
Inserting image in header/footer in excel using jxl
Export JSP page to Excel
Excel steps -
java Excel
read an excel file in .xlsx format