我需要在无人值守的情况下打印SSRS报告,没有弹出窗口和命令行调用。我很难找到一个不使用第三方渲染的例子。我该怎么做呢?
这是我在网上找到的东西:
这个代码是从头开始的,它是基于Visual studio 2008, MSSQL Server 2008环境。
我希望你已经安装并配置了MSSQL Reporting Services 2008,如果没有,请告诉我,我会指导你。
1)配置完Reporting Services 2008后,转到C:Program FilesMicrosoft SQL ServerMSRS10_50.SERVER2K8Reporting ServicesReportServerbin and locate RSClientPrint.cab.
2)复制这个。cab文件到你的网站文件夹。
3)创建myASPX。aspx页
4)创建myHTML.html页面 5)在myASPX中创建IFRAME。 7)在myHTML.html页面 的script标签内编写以下代码<script language="javascript" type="text/javascript">
function getPrint(){
RSCP.MarginBottom = '12.7';
RSCP.MarginLeft = '12.7';
RSCP.MarginRight = '12.7';
RSCP.MarginTop = '12.7'; //
RSCP.Print('http://MYSERVERNAME:8080/RS2K8', '%2fMYDIR%2fMYREPORTNAME(without extension)', 'MyReport');
}
</script>
8) Finally onload event of body
<body onload="getPrint()">
参考