发新话题
打印

导出Excel报未安装excel

导出Excel报未安装excel

复制内容到剪贴板
代码:
if (!jatoolsPrinter.isExcelInstalled(testPrint)) { alert('你的系统没有安装excel,不能导出!', 1); return; } else jatoolsPrinter.exportAsExcel(document.getElementById('tablist')); // 打印预览
电脑已安装office,但一直提示未安装excel,在demo导出excel正常,是什么问题?

TOP

请先引入 print.jatools.com/jatoolsPrinter.js用异步方式调用 isPrintableFileType:
复制内容到剪贴板
代码:
function doPrint(how) { var jatoolsPrinter = getJatoolsPrinter(); jatoolsPrinter.isPrintableFileType('xls', function(res) { if (res) { jatoolsPrinter.printDocument('a.xls', { printer : "pdfFactory", copies : 3, duplex : true, portrait : false, collate : true }); } else alert('请安装MS Office'); }); }
参照在线示例:http://print.jatools.com/docprint.htm

TOP

发新话题