On Fri, 7 Dec 2012, Yegor Kozlov wrote:
There is no method to remove a hyperlink from sheet. There are methid to add/get but not to delete. The collection of hyperlinks in XSSFSheet is private but you can access it via reflection:XSSFHyperlink link = ....; // the hyperlink to remove XSSFSheet sheet = ...; // sheet containing the hyperlink // access the private field XSSFSheet.hyperlinks Field f = XSSFSheet.class.getDeclaredField("hyperlinks"); f.setAccessible(true); List<XSSFHyperlink> hyperlinks = (List<XSSFHyperlink>)f.get(sheet); hyperlinks.remove(link); // remove the link
If you do follow Yegor's advice, and get it working properly, a patch to update POI to do it for you would be very much welcome :)
kNick --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
