aspose 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
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: 41835
    
  63
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 - my free Android networking tools app
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: 41835
    
  63
Search for "jexcelapi faq", it has an example.
shareeef hiasat
Greenhorn

Joined: Aug 27, 2013
Posts: 3
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


;
 
Consider Paul's rocket mass heater.
 
subject: How to insert images in excel using jxl API