xlxs.js“l”单元超链接对象选项如何工作(xlxs.js how does the “l” cell hyperlink object option work)

我目前正在使用以下库来制作excel文档https://github.com/SheetJS/js-xlsx/blob/master/README.md

现在,我的两个细胞看起来像这样

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"}}}

哪一行产生:“报告网址”| ::真的很丑陋的网址::

文档说有一个“l”选项但没有提供如何使用它的文档。 在README中:

细胞对象:

':: l :: cell超链接对象(.Target保存链接,.tooltip是工具提示)'

有没有人有它的exp,我希望excel有一行只有一列说“报告网址”,它将是一个可点击的链接

我试过的所有事情都失败了:

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}}}

有任何想法吗?

Im currently using the following library to make excel documents https://github.com/SheetJS/js-xlsx/blob/master/README.md

right now two of my 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 yield a row with: "Report Url" | ::really long ugly url::

The Documentation says there is an "l" option But gives no documentation as to how to use it. In README:

Cell object:

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

Does anyone have an exp with it, I'd like the excel to have a row with just one column that says "report url" and it would be a clickable link

All the things I tried that 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?

最满意答案

它目前尚未实施。 见未解决的问题 。

另一种方法是使用这样的超链接公式

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

一旦预防问题得到解决,就能实现同样的目标。 这个补丁和另一个遗憾地对我不起作用。

It is currently not implemented. See open issue.

An other approach would be to use a hyperlink formula like this

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

to achieve the same thing as soon as the preventing issue is fixed. This patch and the other one sadly didn't work for me.

xlxs.js“l”单元超链接对象选项如何工作(xlxs.js how does the “l” cell hyperlink object option work)

我目前正在使用以下库来制作excel文档https://github.com/SheetJS/js-xlsx/blob/master/README.md

现在,我的两个细胞看起来像这样

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"}}}

哪一行产生:“报告网址”| ::真的很丑陋的网址::

文档说有一个“l”选项但没有提供如何使用它的文档。 在README中:

细胞对象:

':: l :: cell超链接对象(.Target保存链接,.tooltip是工具提示)'

有没有人有它的exp,我希望excel有一行只有一列说“报告网址”,它将是一个可点击的链接

我试过的所有事情都失败了:

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}}}

有任何想法吗?

Im currently using the following library to make excel documents https://github.com/SheetJS/js-xlsx/blob/master/README.md

right now two of my 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 yield a row with: "Report Url" | ::really long ugly url::

The Documentation says there is an "l" option But gives no documentation as to how to use it. In README:

Cell object:

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

Does anyone have an exp with it, I'd like the excel to have a row with just one column that says "report url" and it would be a clickable link

All the things I tried that 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?

最满意答案

它目前尚未实施。 见未解决的问题 。

另一种方法是使用这样的超链接公式

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

一旦预防问题得到解决,就能实现同样的目标。 这个补丁和另一个遗憾地对我不起作用。

It is currently not implemented. See open issue.

An other approach would be to use a hyperlink formula like this

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

to achieve the same thing as soon as the preventing issue is fixed. This patch and the other one sadly didn't work for me.