Apparently you can add an image using JExcel but it is not supported in the library. Can anyone solve this to add this reference using inline java code?
Example I have found using java below.
}
Example I have found using java below.
B4X:
package com.bethecoder.tutorials.jexcelapi.write;
import java.io.File;
import java.io.IOException;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import jxl.write.WritableImage;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
public class AddImageCellTest {
/**
* @param args
* @throws IOException
* @throws IOException
* @throws WriteException
* @throws BiffException
*/
public static void main(String[] args) throws IOException, WriteException {
//Creates a writable workbook with the given file name
WritableWorkbook workbook = Workbook.createWorkbook(new File("C:/JXL/AddImage.xls"));
WritableSheet sheet = workbook.createSheet("My Sheet", 0);
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();
}
}
}