function outExcel(atblData){
var w = window.open("about:blank", "Excel", "widht=0, height=0");
w.document.write(atblData.outerHTML);
w.document.execCommand('Saveas',true, 'D:\\会员信息.xls');
alert("导出成功!");
window.close();
}
在点击一个按钮新开一个框口之后,把新开框口提交到SEVERLET里 然后在SEVERLET里执行outExcel函数,在IE6里可以弹出保存路径的对话框,但是在IE7里就不会弹出保存路径的对话框,而是直接alert("导出成功!");
请教大虾 这是怎么回事啊??
var w = window.open("about:blank", "Excel", "widht=0, height=0");
w.document.write(atblData.outerHTML);
w.document.execCommand('Saveas',true, 'D:\\会员信息.xls');
alert("导出成功!");
window.close();
}
在点击一个按钮新开一个框口之后,把新开框口提交到SEVERLET里 然后在SEVERLET里执行outExcel函数,在IE6里可以弹出保存路径的对话框,但是在IE7里就不会弹出保存路径的对话框,而是直接alert("导出成功!");
请教大虾 这是怎么回事啊??
function outExcel(atblData){
var w = window.open("about:blank", "Excel", "widht=0, height=0");
w.document.write(atblData.outerHTML);
if(w.document.execCommand('Saveas',true, 'D:\\会员信息.txt))
alert("导出成功");
else
alert("导出失败!");
window.close();
}
• [HKEY_CLASSES_ROOT\.dot] “PerceivedType”=”document”
• [HKEY_CLASSES_ROOT\.xls] “PerceivedType”=”document”
• [HKEY_CLASSES_ROOT\.xlt] “PerceivedType”=”document”
• [HKEY_CLASSES_ROOT\.ppt] “PerceivedType”=”document”
• [HKEY_CLASSES_ROOT\.pot] “PerceivedType”=”document”
开发使用 ExecCommand 函数与 SaveAs 命令一起的脚本。
将第二个参数设置为 True 值 ExecCommand 函数中。请注意 在设置为 True 值 ExecCommand 函数中的第二个参数后,您希望 Internet Explorer 7,运行脚本时显示 另存为 对话框。
在这的种情况下 Internet Explorer 7 可能无法显示 另存为 对话框在计算机上运行脚本时。如果在文本文件类型的文件使用 ExecCommand 函数中设置第三个参数则会出现此问题。 文本文件类型包括.txt 文件、.html 文件和.htm 文件。 将是例如第三个参数设置到.xls 文件 ExecCommand 函数中使用下面的代码。
Document.execCommand('SaveAs',true,’sample.xls’)解决方法
下载组件
XP系统 必须安装 Windows XP Service Pack 2 (SP 2)。
2003系统 Windows Server 2003 Service Pack 2 (SP 2) 或安装 Windows Server 2003 Service Pack 1 (SP 1)。