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

编程入门 行业动态 更新时间:2024-10-12 01:23:51
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.

更多推荐

本文发布于:2023-08-08 01:17:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1466693.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选项   对象   链接   工作   单元超

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!