HSSFWorkbook workBook = (HSSFWorkbook) xlsTransformer.transformXLS(is, map);
HSSFSheet sheet = workBook.getSheetAt(0);
if(StringUtils.isNoneBlank(imagePath)){//导出照片
// 将图片以字节流的方式输入输出 人员照片
//String picture = "D:/Users/dongchuang/Downloads/uploader/userfiles/1/files/3af28628-5b01-4707-a5c0-7f8e9b46c276.PNG";
String picture=Global.getConfig("userfiles.basedir")+imagePath;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
BufferedImage BufferImg = ImageIO.read(new File(picture));
ImageIO.write(BufferImg, imageType, bos);
// public HSSFClientAnchor(int dx1,int dy1,int dx2,int dy2,short
// col1,int row1,short col2,int row2)
//(在起始单元格的X坐标0-1023,Y的坐标0-255,在终止单元格的X坐标0-1023,Y的坐标0-255,起始单元格列数,行数,终止单元格列数,行数)
HSSFClientAnchor anchor = new HSSFClientAnchor(180, 90, 870,130, (short) 18, 3, (short) 19, 6);
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
patriarch.createPicture(anchor, workBook.addPicture(bos.toByteArray(), workBook.PICTURE_TYPE_JPEG));
}
//合并单元格
sheet.addMergedRegion(new CellRangeAddress(11,11+sqHzxxById.getSqGxryList().size(),0,0));//主要关系人员那个合并