繁体   English   中英

Reporting Services-RSClientPrint.Print不是功能

[英]Reporting Services - RSClientPrint.Print is not a function

我正在使用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上运行...

在2016年之前的报表服务中,打印控件为Active-X,仅在Internet Explorer上有效。

对于其他浏览器,您必须导出为PDF或excel并从应用程序中打印。

另外,您可以使报告在一页中呈现并直接从浏览器中打印(不建议)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM