You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Yin,Hang" <ha...@isoftstone.com> on 2015/06/01 02:53:47 UTC

How to link to the cell of outer file with using poi?

Hi:

I can use such code to create a hyper link with poi to link to some outer file.
CreationHelper createHelper = wb.getCreationHelper();
Hyperlink link = createHelper.createHyperlink(Hyperlink.LINK_FILE);
link.setAddress("E:/Test.xlsx");

But I failed to link to the cell use below code:
link.setAddress("E:/Test.xlsx#Sheet!A10");

I know I can use such code to do it :
cell.setCellFormula("HYPERLINK(\"E:/Test.xlsx#Sheet!A10\",\"Link\")");

But my question is if there is any other way to solve this issue ?
Just Like :
link.setAddress("E:/Test.xlsx#Sheet!A10");

Regards
Yin