I recently came across a requirement where i had to add hyperlink in excel Generated By Apache POI in Java. I have gone through the API and Found out that there is no API which Supports this and there is also no cell type which define something like this HSSFCell.CELL_TYPE_HYPERLINK. I tried a lot and Finally Found a hack for this. To our rescue came the Office which has a function called HYPERLINK. I made my life easy and Immediately i had set Formula for that Column.
Here is the snippet for adding HyperLink
cell.setCellFormula(“HYPERLINK(\”” + linkValue+ “\”,\”” + actualValue + “\”)”);
Here LinkValue refers Hyperlink and actualValue refers to the value which is to be hyperlinked.