Excel > JExcel API > How to insert Image in Excel Spreadsheet
How to insert Image in Excel Spreadsheet
Java Excel API is an open source java library to read, write and modify Excel spread sheets.
This requires the library jxl-2.6.12.jar to be in classpath.
The following example shows how to add an Image to Excel Spread sheet.
WritableImage image = new WritableImage(
2, 4, //column, row
6, 6, //width, height in terms of number of cells new File("C:/JXL/google.png")); //Supports only 'png' images
sheet.addImage(image);
//Writes out the data held in this workbook in Excel format
workbook.write();
//Close and free allocated memory
workbook.close();
}