title: Put hyperlink into image in excel (Apache POI)
body: <p>I can set hyperlink for cell in Apache POI, but I don't know how to put the hyperlink into an image (I'm using XSSF)</p>
  
  <p>Here is the function of putting cell hyperlink  :</p>
  
  <pre><code>/**
   * Helper function for putting hyperlink into specified cell
   * @param label
   * @param value
   * @param col
   * @param row
   * @param sheet
   */
  private static void putImageHyperlink(Cell cell, CellStyle hyperlinkStyle, String value, Workbook wb) {
      try {
          CreationHelper createHelper = wb.getCreationHelper();
          Hyperlink link = createHelper.createHyperlink(Hyperlink.LINK_URL);
          link.setAddress(value);
          cell.setHyperlink(link);
          cell.setCellStyle(hyperlinkStyle);
  
          // Put hyperlink value
          cell.setCellValue(value);
      } catch (Exception e) {
          log.severe("Can't create hyperlink : " + Utils.exceptionToString(e));
      }
  }
  </code></pre>
  
  <p>And here is the function for putting image into specified cell :</p>
  
  <pre><code>    /**
   * Put image into sheet at position [row,col]
   * @param sheet
   * @param col
   * @param row
   * @param imgData
   * @throws Exception
   */
  private static void putImage(Workbook wb, Sheet sheet, int col, int row, byte[] imgData) throws Exception {
      try {
          Drawing drawing = sheet.createDrawingPatriarch();
          int pictureIdx = wb.addPicture(imgData, Workbook.PICTURE_TYPE_PICT);
  
          CreationHelper helper = wb.getCreationHelper();
          ClientAnchor anchor4 = helper.createClientAnchor();
  
          //set top-left corner of the picture,
          //subsequent call of Picture#resize() will operate relative to it
          anchor4.setCol1(col);
          anchor4.setRow1(row);
          anchor4.setCol2(col+1);
          anchor4.setRow2(row+1);
  
          drawing.createPicture(anchor4, pictureIdx);
      } catch (Exception ex) {
          log.severe("Exception : " + Utils.exceptionToString(ex));
      }
  }
  </code></pre>
  
  <p>=> How to put hyperlink into picture created by command <strong>drawing.createPicture(anchor4, pictureIdx);</strong> ?</p>
  
  <p>Thanks in advance!</p>