Bug 53710 - cell with hyperlinks in excel when copied by dragging doesn't preserved while importing using POI
Summary: cell with hyperlinks in excel when copied by dragging doesn't preserved while...
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.8-FINAL
Hardware: All Windows XP
: P1 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-13 11:18 UTC by parag patel
Modified: 2012-08-13 15:58 UTC (History)
0 users



Attachments
excel file (18.00 KB, application/vnd.ms-excel)
2012-08-13 11:18 UTC, parag patel
Details
sample java file (2.41 KB, application/octet-stream)
2012-08-13 11:38 UTC, parag patel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description parag patel 2012-08-13 11:18:23 UTC
Created attachment 29216 [details]
excel file

I am going through very strange issue. To generate issue please follow below steps: 

1) create a cell with hyper link in excel. file format is .xls  
2) copy that cell by dragging it vertically for few cells. Now all cells will be having same URL value. 
3) When importing this excel in java using POI api, URL doesn't get preserved. This can be clearly seen by calling cell.getHyperlink() which returns null. 

please note that cell is object of HSSFCell. 

excel file 

Thanks in advance. 

Regards 
Parag  Patel
Comment 1 Yegor Kozlov 2012-08-13 11:36:13 UTC
Can you upload a unit test that demonstrates what's wrong?
Comment 2 parag patel 2012-08-13 11:38:11 UTC
Created attachment 29217 [details]
sample java file

this is sample file which i use to read data from excel
Comment 3 parag patel 2012-08-13 11:43:44 UTC
(In reply to comment #1)
> Can you upload a unit test that demonstrates what's wrong?

sir, i have one java file which read data from excel . which i have already attached with this bug 

and also attached a excel file with this bug
Comment 4 Bodo Wippermann 2012-08-13 12:09:33 UTC
i think your code to read the excel file is invalid.
not every cell in the file has a hyperlink, so getHyperlink() return null.
when ignoring those nulls, you get 7 Hyperlink-adresses , which is expected
Comment 5 parag patel 2012-08-13 15:17:25 UTC
(In reply to comment #4)
> i think your code to read the excel file is invalid.
> not every cell in the file has a hyperlink, so getHyperlink() return null.
> when ignoring those nulls, you get 7 Hyperlink-adresses , which is expected


hi bodo , 

will you pls tell me where can i put wrong code because i cant under stand how to solve this issue .. still i am geting this issue .
Comment 6 Yegor Kozlov 2012-08-13 15:58:56 UTC
Parag,

Fursly, please do not abuse the POI issue tracker. You will get nothing by setting prioriry of a bug to blocker. POi is a volunteer project, if a problem is important for you then do work on it and contribute! 

Secondly, re-read what Bodo wrote: the sheet contains one hyperlinks that spans across multiple cells.

the Hyperlink object has methods getFirstRow() and getLastRow() , in your case they return different values, i.e. getFirstRow() ! getLastRow() which means that the hyperlink spans across several cells.

Yegor 


(In reply to comment #5)
> (In reply to comment #4)
> > i think your code to read the excel file is invalid.
> > not every cell in the file has a hyperlink, so getHyperlink() return null.
> > when ignoring those nulls, you get 7 Hyperlink-adresses , which is expected
> 
> 
> hi bodo , 
> 
> will you pls tell me where can i put wrong code because i cant under stand
> how to solve this issue .. still i am geting this issue .