Xlxs.js, how the cell hyperlink object option “l” works

I am currently using the following library to create Excel documents https://github.com/SheetJS/js-xlsx/blob/master/README.md

right now my two cells look like this:

ws[XLSX.utils.encode_cell({c: 0, r: 1})] = {v: "Report Url", s: {font : {sz : "11", bold : true}}}
ws[XLSX.utils.encode_cell({c: 1, r: 1})] = {v: self.url, s: {font : {sz : "11"}}}

Which gives a line with: "Report Url" | :: a really long ugly url ::

The documentation states that there is an option "l". But it does not provide any documentation regarding its use. In README:

Cell Object:

':: l :: cell hyperlink object (.Target contains a link, .tooltip is a tooltip)'

Does anyone have an experiment, I would like excel to have a row with only one column that says “report url” and this will be a click link

All I tried failed:

ws[XLSX.utils.encode_cell({c: 0, r: 1})] = {l: self.url, s: {font : {sz : "11", bold : true}}}
ws[XLSX.utils.encode_cell({c: 0, r: 1})] = {v: "url", l: self.url, s: {font : {sz : "11", bold : true}}}
ws[XLSX.utils.encode_cell({c: 0, r: 1})] = {v: Target,l: {Target :self.url}, s: {font : {sz : "11", bold : true}}}
ws[XLSX.utils.encode_cell({c: 0, r: 1})] = {l: {Target :self.url}, s: {font : {sz : "11", bold : true}}}

Any ideas?

+4
1

. . .

,

ws[XLSX.utils.encode_cell({
    c: 0,
    r: 0
})] = {
    f: '=HYPERLINK("http://www.google.com","Google")'
};

, . , , .

+3

Source: https://habr.com/ru/post/1606627/


All Articles