I add the image to the worksheet through the following code:
Drawing drawing = sheet.createDrawingPatriarch();
ClientAnchor anchor = new HSSFClientAnchor((short)0, (short)0, (short)0, (short)0, (short)0, (short)0, (short)2, (short)5)
anchor.setAnchorType(2)
HSSFPicture pict = drawing.createPicture(anchor, this.images.get("logo"));
pict.resize() ;
However, immediately after adding the images, I resize the columns, which seems to ruin the situation. It resizes images - this is not what I want.
public void autoSizeColumns() {
def cols = (StartColumn..this.cMax)
cols.each { i ->
sheet.autoSizeColumn i
}
}
BrandedWorksheet v;
v.autoSizeColumns()
If I do not execute autoSizeColumns (), the image matches the size.
Is there a way to have both?
source
share