谷歌浏览器(Chorme) 水晶报表(Crystal Report )ReportViewer无法打印,无打印按钮

1.ReportViewer中的Js在Chrome下会造成死循环。重写ReportViewer的Render事件

public class MyReportViewer : Microsoft.Reporting.WebForms.ReportViewer
    {
protected override void Render(HtmlTextWriter writer)
        {
using (StringWriter sw = new StringWriter())
            {
                HtmlTextWriter tmpWriter = new HtmlTextWriter(sw);
base.Render(tmpWriter);
string val = sw.ToString();
                val = val.Replace(@"!= 'javascript:\'\''", @"!= 'javascript:\'\'' && false");
                writer.Write(val);
            }
        }
    }

2.说说无打印按钮吧

因为Crystal Report 的打印按钮是基于第三方AcitveX的,Chorme等不支持,所以只能用IE,Chorme,Firefox,Safari就免了

3.Chorme调用打印

<input id="Button" type="button" value="单单的打印" onclick='javascript:window.print()'/>

4.Chorme如何去除ReportViewer的菜单栏

 

5.Chorme如何设置打印格式等

你可能感兴趣的:(打印,chrome,报表,谷歌浏览器,Crystal)