Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperlinks support #6

Open
vinodmehta opened this issue Jul 22, 2015 · 5 comments
Open

Hyperlinks support #6

vinodmehta opened this issue Jul 22, 2015 · 5 comments

Comments

@vinodmehta
Copy link

Looking at all the options here: https://github.com/protobi/js-xlsx#cell-styles

Couldn't figure it out if it is possible to create hyperlinks inside the cell.
Is that possible?

@protobi
Copy link
Collaborator

protobi commented Jul 22, 2015

Hyperlink formatting isn't covered (yet).

For quick I created a cell with a hyperlink to a workbook, unzipped (jar -xfv ex1.xlsx) and opened up in WebStorm to see what this might entail.

The file /xl/styles.xml defines an <xf> element that references a <cellStyle> element defined in a section <cellStyles> that defines a few other built in styles around the idea of hyperlinks.

So it seems that hyperlinks are actually styles, and it should be technically possible to add. But for right now that's not in.

<cellXfs>
...
    <xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="7"/>
</cellXfs>
<cellStyles count="8">
        <cellStyle name="Followed Hyperlink" xfId="2" builtinId="9" hidden="1"/>
        <cellStyle name="Followed Hyperlink" xfId="4" builtinId="9" hidden="1"/>
        <cellStyle name="Followed Hyperlink" xfId="6" builtinId="9" hidden="1"/>
        <cellStyle name="Hyperlink" xfId="1" builtinId="8" hidden="1"/>
        <cellStyle name="Hyperlink" xfId="3" builtinId="8" hidden="1"/>
        <cellStyle name="Hyperlink" xfId="5" builtinId="8" hidden="1"/>
        <cellStyle name="Hyperlink" xfId="7" builtinId="8"/>
        <cellStyle name="Normal" xfId="0" builtinId="0"/>
    </cellStyles>

@vinodmehta
Copy link
Author

Thanks @protobi for verifying this.
So I added the link using the formula by setting cell data as:
{
v: '=HYPERLINK("http link", "some text")',
t: 's'
}

Is that what you did?
The cell just shows the above string as it is and doesn't execute it.
Are formulae in general not working?

@protobi
Copy link
Collaborator

protobi commented Jul 23, 2015

@vinodmehta Hyperlink formatting is not part of js-xlsx yet. My note was more about exploring what it would take to add it. To explore that I created a workbook with a hyperlink using Excel, and then inspected the .pptx file directly in a development environment to see how that hyperlink was represented.

@Bhawnananda
Copy link

Bhawnananda commented May 25, 2017

Any update on this Issue? When can we expect it ?

jsandmeyer pushed a commit to jsandmeyer/js-xlsx-custom that referenced this issue Jul 13, 2017
- XLSX read/write defined names
- XLSB/XLS/XLML read defined names

Issues:
- fixes protobi#83 h/t @developergdd
- fixes protobi#6 , fixes SheetJS#599
@rildomar
Copy link

up

RimaCiklum pushed a commit to Folcon/js-xlsx that referenced this issue Aug 19, 2020
- XLSX read/write defined names
- XLSB/XLS/XLML read defined names

Issues:
- fixes protobi#83 h/t @developergdd
- fixes protobi#6 , fixes SheetJS#599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants