Created attachment 29365 [details] xsl file for testing Step to reproduce issue:- ======================== 1. Create a xls file with one cell with a hyperlink.(Address of hyperlink should having number sign(#) in it. e.g "http://www.bailii.org/databases.html#uk") 2. Try to read address of hyperlink. It will give link address as "uk".Only characters after Address number sign (#) is considered as hyperlink address. Code snippet:- ============= String strLinkAddress = cell.getHyperlink().getAddress(); It will return "uk" as link address instead of "http://www.bailii.org/databases.html#uk" An xls file is attached for test.
What does BiffViewer report for the hyperlink related records? Do it show the full URL, or does it see just the anchor?
Created attachment 29367 [details] Test program
Created attachment 29368 [details] test.xls file used in program to read address of hyperlink in a cell
I'm just trying to read a address of hyperlink given in a cell. But instead of giving a full URL it gives only characters after #. I have attached a simple program and a test xls file here in aatachment.
Please try using org.apache.poi.hssf.dev.BiffViewer to see if the hyperlink is stored in multiple records or not, and if BiffViewer can see the full url or just the anchor.
I have treid using org.apache.poi.hssf.dev.BiffViewer and the hyperlink is stored in records , and BiffViewer can see just the anchor in url. record is shown as [HYPERLINK RECORD] .range = A1 .guid = 79EAC9D0-BAF9-11CE-8C82-00AA004BA90B .linkOpts= 0x0000001F .label = kirti .moniker = 79EAC9E0-BAF9-11CE-8C82-00AA004BA90B .textMark= uk .address = uk [/HYPERLINK RECORD]
Just found this on Microsoft's - http://support.microsoft.com/kb/202261 - do not know if is strictly relevant but it does indicate that the # character cannot be included within hyperlinks in Office documents. The focus of the document appears top be upon # characters embedded into file names but I do wonder if the same restriction may be applied here.
I have tried to found solution for this issue on net but can't got yet. Is there any possibility that this issue can be resolved in future version of Apache POI.?
I am having exactly the same problem. Is it planned a fix for this? Someone is working on this?
(In reply to javier.pajaro from comment #9) > I am having exactly the same problem. Is it planned a fix for this? Someone > is working on this? Sorry, I am using POI 3.9. The bug was reported under 3.8. Why is not considered important?
All work done on Apache POI is done by people who kindly volunteer their time. The importance of what work gets done is decided by those willing to put in their own time to do it! If this bug is important to you, please consider investigating and submitting a patch. You would most likely need to read the Microsoft documentation on the format, run some sample files through something like BiffViewer to see how it works, then make changes to the POI code to handle how these hyperlinks are coded. If you get it working, please then attach the patch to this bug, so others can benefit!
(In reply to Nick Burch from comment #11) > All work done on Apache POI is done by people who kindly volunteer their > time. The importance of what work gets done is decided by those willing to > put in their own time to do it! > > If this bug is important to you, please consider investigating and > submitting a patch. You would most likely need to read the Microsoft > documentation on the format, run some sample files through something like > BiffViewer to see how it works, then make changes to the POI code to handle > how these hyperlinks are coded. If you get it working, please then attach > the patch to this bug, so others can benefit! Ok, I will try. But, it would be easier for the guy who wrote the Hyperlink record. Dont you think the same? I am not asking for a new feature, just a fix.
(In reply to javier.pajaro from comment #12) > Ok, I will try. But, it would be easier for the guy who wrote the Hyperlink > record. Dont you think the same? I am not asking for a new feature, just a > fix. HyperlinkRecord was first introduced to the codebase over 5 years ago, and a quick "svn log" shows that a large number of people have worked on it over that time, both committers and external contributors. There's no one person who "owns" any of the code, so anyone can (and is encouraged to!) dive in and submit patches to enhance it