【发布时间】:2017-01-24 18:57:02
【问题描述】:
我正在使用 Reporting Services 制作报告,并尝试使用我找到的脚本将其从 html 文件直接打印到默认打印机:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<BODY onload="Print()">
<object id="RSClientPrint" classid="CLSID:5554DCB0-700B-498D-9B58-4E40E5814405"
codebase="C:\\Program Files\\Microsoft SQL Server\\MSRS11.MSSQLSERVER\\Reporting Services\\ReportServer\\bin\\RSClientPrint-x86.cab#Version=1,0,0,0"
viewastext></object>
<script language="javascript">
function Print(){
RSClientPrint.MarginLeft = 12.7;
RSClientPrint.MarginTop = 12.7;
RSClientPrint.MarginRight = 12.7;
RSClientPrint.MarginBottom = 12.7;
RSClientPrint.Culture = 1033;
RSClientPrint.UICulture = 9;
RSClientPrint.Print('http://localhost/ReportServer', '/Pages/ReportViewer.aspx?%2fInventario%2fReport1&rs:Command=Render', 'Report1')
}
</script>
</BODY>
</html>
但是当我执行文件时,我得到了这个错误:
Uncaught TypeError: RSClientPrint.Print is not a function
at Print (index.html:21)
at onload (index.html:5)
谁能帮我解决这个问题...?
编辑 1
在 Internet Explorer 上它可以完美运行......!!也许有办法让它在 Chrome 或 Firefox 上运行......
【问题讨论】:
标签: javascript google-chrome firefox reporting-services printing