简体   繁体   中英

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:

<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

On Internet Explorer it works perfectly....!! Maybe there's is a way to make it work on Chrome or Firefox...

In reporting services prior to 2016, the print control is Active-X, which works only on Internet Explorer.

For other browsers you have to export to PDF or excel and print from the application.

Also you can make the report render in one page and print directly from the browser (not suggested)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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