Hello,
I have written a Java program using the Apache POI classes, which creates
worksheets in an HSSFWorkbook,
and inserts images in them, as follows:
-----------------------------------------
byte[] imageBlog = <get contents of blob from database>;
int pictureIdx = wb.addPicture(imageBlog, Workbook.PICTURE_TYPE_JPEG);
Sheet imageSheet = wb.createSheet("Picture " + pictureIdx);
Drawing drawing = imageSheet.createDrawingPatriach();
ClientAnchor anchor = creationHelper.createClientAnchor();
anchor.setCol1(1);
anchor.setRow1(1);
Picture pict = drawing.createPicture(anchor, pictureIdx);
pic.resize();
imageSheet.autoSizeColumn((short)1);
--------------------------------------------
Although this program works fine on my development machine, the "image
worksheets" don't contain any images when generated on the Linux Test Server
and displayed on a Windows 7 machine after downloading them with a browser.
I have checked the image data's length using the following code
logger.info(pict.getPictureData().getData().length
but to no avail, as it exactly matches the blob's size, which means that the
issue is not a data-retrieval one.
Any help would be much appreciated.
Philippe
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]