我在我的网络应用程序中使用.rdlc报告,将报告导出到pdf &打印效果很好,但现在我想自动打印报告(我点击打印按钮。)直接打印asp.net报表查看器
Is it possible to print rdlc report automatically?
请帮助我, &谢谢。
我在我的网络应用程序中使用.rdlc报告,将报告导出到pdf &打印效果很好,但现在我想自动打印报告(我点击打印按钮。)直接打印asp.net报表查看器
Is it possible to print rdlc report automatically?
请帮助我, &谢谢。
是否可以自动打印rdlc报告?
如果你可以在页面上渲染它,你可以使用javascript window.print(),打印当前窗口。正如sinni800所说的渲染报告在单独的页面上。
这样的事情,
与其他内容页面上添加该按钮:
<a href="javascript:window.open('/print-content.html','_blank');">print report</a>
打开的窗口第一个参数是页面报表浏览器,可在该页面你可以开始打印在负载事件,像这样:
<body id="top" onload="window.print();">
rendered report here
</body>
但是,如果你问我更好地坚持你目前的解决方案。
您可以将报表保存在磁盘上的PDF,与Javscript打开它,然后打印出来,有一个确切的方案代码项目一个例子,因为我understud你:
http://www.codeproject.com/Tips/376300/Custom-Print-functionality-for-Microsoft-Report-Vi
对不起,它会打印窗口中的任何内容,但我的报告宽度超过窗口大小,因此使用上述代码打印隐藏的内容是不可能的?我对吗? –
是的,打印所有窗口内容,如果您在该窗口上使用选择打印在浏览器 –
是否有任何其他选项来打印毫秒报告(rdlc)中的所有内容? –
实际上,当您在Internet Explorer中打开您的rdlc报告时,报告必须具有执行该打印作业的按钮。
是的你的权利Alper,但我主要集中在铬或在Mozilla工作,因为我的应用程序添加CSS将不能正确支持探索。 –
如果你的目标的Active-X功能的浏览器(IE恩)以下解决方案应该工作:
<script language="javascript">
function PrintReport() {
var viewerReference = $find("ReportViewer1");
var stillonLoadState = viewerReference.get_isLoading();
if (!stillonLoadState) {
var reportArea = viewerReference .get_reportAreaContentType();
if (reportArea == Microsoft.Reporting.WebFormsClient.ReportAreaContent.ReportPage) {
$find("ReportViewer1").invokePrintDialog();
}
}
}
</script>
Kindlyy注意,该解决方案将无法在浏览器上的工作,不支持Active-X
您可以在新的浏览器窗口中添加一个无控制报告查看器并打印整个事物。 – sinni800
可能的重复:http://stackoverflow.com/questions/731049/how-to-print-a-reportviewers-report-without-showing-a-form –
@ sinni800:\t 对不起,我没有得到,可以你请详细说明如何去做? –