ASF Bugzilla – Attachment 35813 Details for
Bug 62222
getLabel for Hyperlink returns always null for xlsx files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Java class
Poi.java (text/plain), 1.23 KB, created by
Alexander Vitkovskiy
on 2018-03-27 07:01:10 UTC
(
hide
)
Description:
Java class
Filename:
MIME Type:
Creator:
Alexander Vitkovskiy
Created:
2018-03-27 07:01:10 UTC
Size:
1.23 KB
patch
obsolete
>package playground; > >import java.io.FileInputStream; > >import org.apache.poi.hssf.usermodel.HSSFCell; >import org.apache.poi.hssf.usermodel.HSSFHyperlink; >import org.apache.poi.hssf.usermodel.HSSFWorkbook; >import org.apache.poi.xssf.usermodel.XSSFCell; >import org.apache.poi.xssf.usermodel.XSSFHyperlink; >import org.apache.poi.xssf.usermodel.XSSFWorkbook; > >public class Poi { > > public static void main(String[] args) { > > try (FileInputStream isXLSX = new FileInputStream("1.xlsx");FileInputStream isXLS = new FileInputStream("1.xls")) { > XSSFWorkbook workbookX = new XSSFWorkbook(isXLSX); > XSSFCell cellX = workbookX.getSheetAt(0).getRow(0).getCell(0); > > XSSFHyperlink hyperlinkX = cellX.getHyperlink(); > System.out.println("Address: " + hyperlinkX.getAddress()); > System.out.println("Label: " + hyperlinkX.getLabel()); > workbookX.close(); > > > HSSFWorkbook workbook = new HSSFWorkbook(isXLS); > HSSFCell cell = workbook.getSheetAt(0).getRow(0).getCell(0); > HSSFHyperlink hyperlink = cell.getHyperlink(); > System.out.println("Address: " + hyperlink.getAddress()); > System.out.println("Label: " + hyperlink.getLabel()); > workbook.close(); > > } catch (Exception e) { > e.printStackTrace(); > } > > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 62222
: 35813 |
35814
|
35815