excel-streaming-reader icon indicating copy to clipboard operation
excel-streaming-reader copied to clipboard

getting Hyperlink of Cell

Open ElsayedAwdElsayed opened this issue 8 years ago • 4 comments

I 'am trying to get hyperlink of a cell and also the label by this way

Row row=rowIterator.next();
Iterator<Cell> cellIterator = row.cellIterator();
currentCell = cellIterator.next();
parthyperlink=currentCell.getHyperlink().getAddress();
String label=currentCell.getHyperlink().getLabel();

and I 'am getting this Exception

com.monitorjbl.xlsx.exceptions.NotSupportedException at com.monitorjbl.xlsx.impl.StreamingCell.getHyperlink(StreamingCell.java:353) at com.z2data.mapping.ExeclHorizental.getCurrentRow(ExeclHorizental.java:88)

please any help :)

Thanks in Advance ..........

ElsayedAwdElsayed avatar Mar 06 '17 14:03 ElsayedAwdElsayed

This library has an incomplete implementation of the POI Cell interface. A good deal of the methods are not compatible with a streaming back end, but there are quite a few that haven't been implemented because no one has needed them yet.

I'd lean towards this being in the latter group. I don't think there are any conflicts with a streaming back end to return a hyperlink.

monitorjbl avatar Mar 06 '17 17:03 monitorjbl

Unfortunately it looks like the <hyperlinks> are written out at the end of the document (at least, they are in my case) so I'm not sure this can work with SAX. I'm trying to create an XLSX diff tool that needs streaming due to the size of my documents so, @monitorjbl , if you have any ideas on how to get this working, I'm all ears. I'm not particularly familiar with SAX (worked with it once so not totally foreign) but would be happy to re-contribute something to make this work if I can.

Ref:

<?xml version="1.0" encoding="UTF-8"?>
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
    <dimension ref="A1:C2" />
    <sheetViews>
        <sheetView workbookViewId="0" tabSelected="true" />
    </sheetViews>
    <sheetFormatPr defaultRowHeight="15.0" />
    <sheetData>
        <row r="1">
            <c r="A1" s="1" t="n">
                <v>0.0</v>
            </c>
            <c r="B1" s="2" t="n">
                <v>1.0</v>
            </c>
        </row>
        <row r="2">
            <c r="A2" s="3" t="n">
                <v>1.0</v>
            </c>
            <c r="B2" s="4" t="n">
                <v>2.0</v>
            </c>
        </row>
    </sheetData>
    <hyperlinks>
        <hyperlink ref="A1" r:id="rId1" />
    </hyperlinks>
    <pageMargins bottom="0.75" footer="0.3" header="0.3" left="0.7" right="0.7" top="0.75" />
</worksheet>

Logic-32 avatar May 16 '18 20:05 Logic-32