本文介绍了xlxs.js如何执行"l"操作单元超链接对象选项工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Im currently using the following library to make excel documentshttps://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"}}}

使用以下命令生成一行:"Report Url" |::真的很丑陋网址::

Which yield a row with: "Report Url" | ::really long ugly url::

文档说有一个"l"选项,但是没有提供有关如何使用它的文档.在自述文件中:

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

单元格对象:

':: l ::单元超链接对象(.Target包含链接,.tooltip为工具提示)'

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

有人有经验吗,我希望excel的行只有一列,上面写着报告网址",这将是一个可点击的链接

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

有什么想法吗?

推荐答案

当前未实现.参见未解决问题.

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

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"操作单元超链接对象选项工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 12:03
查看更多