如何在Firefox和Crome中的报表查看器中显示“打印"按钮 [英] How to show Print button in Report viewer in Firefox and Crome
本文介绍了如何在Firefox和Crome中的报表查看器中显示“打印"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Firefox和Crome中,asp.net c#的报表查看器中未显示打印按钮.但是它可以在IE中找到.是否有任何.dll来显示打印按钮.
In Firefox and Crome print button not shown in Report viewer in asp.net c#.But it works find in IE.Is there any .dll to show the print button.
推荐答案
以下链接中的简单Google搜索结果.打印按钮是一个ActiveX控件,这意味着它只能在IE中使用.但是:
Microsoft Report Viewer(RDLC)的自定义打印功能 [ ^ ]
http://www.codicode.com/art/cross_browser_printing_with_asp_net_reportviewer.aspx [
A simple google search results in the following links. The print button is an ActiveX control which means it will only work in IE. However:
Custom Print Functionality for Microsoft Report Viewer (RDLC)[^]
http://www.codicode.com/art/cross_browser_printing_with_asp_net_reportviewer.aspx[^]
在设计人员或代码.
或
下面给出的是获取报表查看器打印功能的代码.
Set the ShowExportControls property to true in the designer or code.
or
Given below is code to get print facility for Report Viewer.
//call printdiv() function on button click
<input name="b_print" type="button" onclick="printdiv();" value=" Print Report" />
//function for print
function printdiv() {
//Code for adding HTML content to report viwer
var headstr = "<html><head><title></title></head><body>";
//End of body tag
var footstr = "</body></html>";
//This the main content to get the all the html content inside the report viewer control
//"ReportViewer1_ctl10" is the main div inside the report viewer
//controls who helds all the tables and divs where our report contents or data is available
var newstr =
(#ReportViewer1_ctl10").html(); //打开空白html进行打印 var popupWin = window.open('','_blank'); //将打印数据粘贴在空白的html页面中 popupWin.document.write(headstr + newstr + footstr); //打印页面,看看所见即所得 popupWin.print(); 返回false; }
("#ReportViewer1_ctl10").html(); //open blank html for printing var popupWin = window.open('', '_blank'); //paste data of printing in blank html page popupWin.document.write(headstr + newstr + footstr); //print the page and see is what you see is what you get popupWin.print(); return false; }
看看这个. Chrome,Mozilla浏览器中的报表查看器打印问题 [ ^ ]
Have a look at this. Report Viewer Print Problem in Chrome, Mozilla Browsers[^]
这篇关于如何在Firefox和Crome中的报表查看器中显示“打印"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文