This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 41127
    
  45
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: 41127
    
  45
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


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