简体   繁体   English

Reporting Services-RSClientPrint.Print不是功能

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

I am making a report with Reporting Services and I've trying to print it directly to the default printer from a html file with a script that I found: 我正在使用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>

But when I execute the file, I'm getting this error: 但是,当我执行文件时,出现此错误:

Uncaught TypeError: RSClientPrint.Print is not a function
    at Print (index.html:21)
    at onload (index.html:5)

Can anybody help me with this...? 有人可以帮我吗?

EDIT 1 编辑1

On Internet Explorer it works perfectly....!! 在Internet Explorer上,它运行完美。 Maybe there's is a way to make it work on Chrome or Firefox... 也许有一种方法可以使其在Chrome或Firefox上运行...

In reporting services prior to 2016, the print control is Active-X, which works only on Internet Explorer. 在2016年之前的报表服务中,打印控件为Active-X,仅在Internet Explorer上有效。

For other browsers you have to export to PDF or excel and print from the application. 对于其他浏览器,您必须导出为PDF或excel并从应用程序中打印。

Also you can make the report render in one page and print directly from the browser (not suggested) 另外,您可以使报告在一页中呈现并直接从浏览器中打印(不建议)

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

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