mardi 4 août 2015

Trying to add hyperlink to excel cell but result is filepath

I'm trying to add a hyperlink to excel cell using java as follows.

XSSFCreationHelper helper= xssfWorkbook.getCreationHelper();
XSSFHyperlink url_link=helper.createHyperlink(Hyperlink.LINK_URL);
cell.setCellValue("some Text");
url_link.setAddress("www.google.com");
cell.setHyperlink(url_link);

But when I created the excel file, cell contains wrong url, something as follows.

file:///C:/Users/..../www.google.com

What is I'm doing wrong here? Appreciate any help

Aucun commentaire:

Enregistrer un commentaire