Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/436.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用js XLSX编写包含注释的XLSX文件_Javascript_Excel_Xlsx_Js Xlsx - Fatal编程技术网

Javascript 使用js XLSX编写包含注释的XLSX文件

Javascript 使用js XLSX编写包含注释的XLSX文件,javascript,excel,xlsx,js-xlsx,Javascript,Excel,Xlsx,Js Xlsx,当我们使用js-XLSX编写XLSX文件时,是否可以插入一些单元格注释? 当我读取包含某些单元格注释的文件时,它们会在我读取该文件时出现: > var wb = XLSX.readFile("Book1comments.xlsx") undefined

当我们使用
js-XLSX
编写XLSX文件时,是否可以插入一些单元格注释? 当我读取包含某些单元格注释的文件时,它们会在我读取该文件时出现:

> var wb = XLSX.readFile("Book1comments.xlsx")                                                      
undefined                                                                                           
> wb.Sheets.Sheet1.A1.c                                                                             
[ { a: 'Stéphane Laurent',                                                                         
    t: 'Stéphane Laurent:\r\nhello',                                                                
    r: '<r><rPr><b/><sz val="9"/><color indexed="81"/><rFont val="Tahoma"/><charset val="1"/></rPr><
t>Stéphane Laurent:</t></r><r><rPr><sz val="9"/><color indexed="81"/><rFont val="Tahoma"/><charset 
val="1"/></rPr><t xml:space="preserve">\r\nhello</t></r>',                                          
    h: '<span style="font-weight: bold;">Stéphane Laurent:</span><span style=""><br/>hello</span>' 
} ]                                                                                                 
然后在创建的文件中不再有注释


PS:我试图删除Stéphane中的奇怪字符,但这仍然不起作用。

从0.8.1开始,这是不可能的,因为可以看到与编写注释相关的每个函数都是空的:


看起来现在可以使用:
XLSX.writeFile(wb, "Book1comments_rewritten.xlsx")
function write_comments_xml(data, opts) { }
function write_comments_bin(data, opts) { }
/*
function write_cmnt(data, name, opts) {
    return (name.substr(-4)===".bin" ? write_comments_bin : write_comments_xml)(data, opts);
}
*/