Created attachment 27132 [details] Header Image Problem Hi, My Requirement is insert image to header inn excel file, As POI doesn't support for this, I have created Image header in Template Excel File manually by using MS-Excel. Then I opened that Excel File by using POI(POIFSFileSystem) and then after I have Manipulated String data and Images into that existing Excel Template. I have stored above entire workbook in another excel file. Then when I pen that excel file, in that file Header Image and data coming, I'm not able to see the Image which I have inserted after opening that excel. Please help me in this case. Here I'm attaching that files Thanks, shafiulla
It is a limitation of HSSF - it can create drawings from scratch, but cannot modify existing ones. This means that if you add an image to a sheet that already has graphic objects then the existing graphic objects are invalidated. XSSF does not have this limitation and should work fine for you. Convert your template in the .xlsx format and you will be good. P.S. Please post usage questions to the poi-user list. Bugzilla is for submitting bugs. Yegor *** This bug has been marked as a duplicate of bug 51287 ***
This problem should be fixed in trunk. Anyway, you have a bug in your code. ClientAnchor anchor=helper.createClientAnchor(); int picIndex=wb.addPicture(img_bytes.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG); anchor.setRow1(5); anchor.setCol1(1); anchor.setCol2(2); anchor.setRow2(5); Anchor.row1 == anchor.row2 and anchor.dx1 == anchor.dx2 , so the width of your image is equals to 0 Please try with a nightly build - see download links on http://poi.apache.org/ or build yourself from SVN trunk, see http://poi.apache.org/subversion.html