Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.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
Export to excel Syncfusion Essential JS2网格在导出到MS Excel 2016时显示带有URL的HTML标记_Export To Excel_Syncfusion - Fatal编程技术网

Export to excel Syncfusion Essential JS2网格在导出到MS Excel 2016时显示带有URL的HTML标记

Export to excel Syncfusion Essential JS2网格在导出到MS Excel 2016时显示带有URL的HTML标记,export-to-excel,syncfusion,Export To Excel,Syncfusion,我使用syncfusion-ej2网格()实现了导出到excel的功能。网格中有一列包含URL。导出完成后,这些链接将以HTML语法显示在excel工作表上。我已经在互联网上搜索过了,找不到任何解决方案。请告知。我们建议您使用Grid的“excelQueryCellInfo”事件。在“excelQueryCellInfo”事件处理程序函数中,我们删除了单元格数据中包含的锚定标记,只传递要导出到excel的文本内容。请参考下面的代码示例 [html] <ejs-grid #mast

我使用syncfusion-ej2网格()实现了导出到excel的功能。网格中有一列包含URL。导出完成后,这些链接将以HTML语法显示在excel工作表上。我已经在互联网上搜索过了,找不到任何解决方案。请告知。

我们建议您使用Grid的“excelQueryCellInfo”事件。在“excelQueryCellInfo”事件处理程序函数中,我们删除了单元格数据中包含的锚定标记,只传递要导出到excel的文本内容。请参考下面的代码示例

[html]    

<ejs-grid #masterGrid [dataSource]='data' ... [allowExcelExport]='true' (excelQueryCellInfo)='excelQueryCellInfo($event)'>
    ...
</ejs-grid>
我们还准备了一份样品供您参考。请参考下面的链接, 样本:

文件:

马杜 [融合小组]

excelQueryCellInfo(args:any):void{
  if(args.column.field == "CustomerID"){        //Check for the “CustomerID” column which has the anchor data 
    let container:any = document.createElement("div");
    container.innerHTML = args.value;
    args.value = container.textContent;          //Pass only the string content to be exported to excel
  }
}