javascript - Reporting Services - RSClientPrint.Print 不是函数

标签 javascript google-chrome firefox reporting-services printing

我正在使用 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 并从应用程序打印。

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

关于javascript - Reporting Services - RSClientPrint.Print 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41836841/

相关文章:

javascript - JS/HTML - onresize 不触发

javascript - 平移和缩放后鼠标单击转换为 svg

javascript - Chrome使用jquery时出现问题

使用 Firefox 实时预览的 HTML 编译器 INSTEAD of google chrome

javascript - 在 Angular 6 中对可观察到的表进行排序

javascript - 如何在gulp中获取任务内部的任务名称

google-chrome - 使用背景大小 : cover 的 Chrome 性能不佳

jquery - 使用 jQuery 在 Firefox 中单选按钮不传递值

internet-explorer - 更好的 IE 开发工具(有限制)

firefox - Firefox 附加组件是否有默认许可证?