【问题标题】:Reporting Services - RSClientPrint.Print is not a functionReporting Services - RSClientPrint.Print 不是函数
【发布时间】:2017-01-24 18:57:02
【问题描述】:

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

【问题讨论】:

    标签: javascript google-chrome firefox reporting-services printing


    【解决方案1】:

    在 2016 年之前的报告服务中,打印控件是 Active-X,它仅适用于 Internet Explorer。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-26
      相关资源
      最近更新 更多