簡體   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