I have a problem reading an excel file containing the hyperlink text in poi.
Data like this (excel file):
| 1 | type | category | job_type | position | name | Email
| 2 | Test | developer | part time | manager | hong | ASDF ## @ dsaf.com (hyperlink)
| 3 | Test | developer | part time | manager | asde | test@mail.com (hyperlink)
| 4 | Test | developer | part time | manager | asde | aaaaaaa (not a hyperlink)
To create a workbook object, I use the WorkbookFactory.create(InputStream inp) method.
The codes are here:
public POIExcelImport(String name, InputStream inputStream) throws ExcelImportException { super(name, null); try { logger.debug("before work : {}", this.workbook); this.workbook = WorkbookFactory.create(inputStream);
When I call the create method, an Exception is thrown.
java.lang.IllegalStateException: The hyperlink for cell F2 references relation rId1, but that didn't exist! at org.apache.poi.xssf.usermodel.XSSFHyperlink.<init>(XSSFHyperlink.java:71) ~[poi-ooxml-3.8.jar:3.8] at org.apache.poi.xssf.usermodel.XSSFSheet.initHyperlinks(XSSFSheet.java:204) ~[poi-ooxml-3.8.jar:3.8] at org.apache.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:157) ~[poi-ooxml-3.8.jar:3.8] at org.apache.poi.xssf.usermodel.XSSFSheet.onDocumentRead(XSSFSheet.java:129) ~[poi-ooxml-3.8.jar:3.8] at org.apache.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:269) ~[poi-ooxml-3.8.jar:3.8] at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:159) ~[poi-ooxml-3.8.jar:3.8] at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:183) ~[poi-ooxml-3.8.jar:3.8] at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:73) ~[poi-ooxml-3.8.jar:3.8] at dreaminfra.ipams.common.excel.poi.POIExcelImport.<init>(POIExcelImport.java:49) ~[ipams-core-1.0.0.jar:na]
I want to remove the hyperlink, but there are only problems associated with creating the hyperlink.
I have no idea, are there any ideas?
source share