samedi 18 avril 2015

HSSFHyperlink and URL fragment encoding

I am using the apache poi package to generate excel workbooks. In the workbook I include cells with hyperlinks, using URLs containing fragments (#frag). In the resulting cells, the # character in the url has been encoded which makes it a different URL.


My question: Is there any way to preserve the URL provided as is?


My code:



Cell cell = row.createCell(index);
cell.setCellValue("the link");
HSSFHyperlink link = workbook.getCreationHelper().createHyperlink(HSSFHyperlink.LINK_URL);
link.setAddress("http://localhost:3000/#/search/pattern");
cell.setHyperlink(link);


The url opened in the browser after clicking on the link in the generated spreadsheet



http://localhost:3000/%23/search/pattern


Any pointer appreciated.


Aucun commentaire:

Enregistrer un commentaire