asp.net – SQL Reporting Services – 打印按钮未显示在Mozilla

我正在使用sql Reporting Services,它工作正常,并在IE中显示一个打印按钮,但Mozilla Firefox中未显示.

有人有什么想法吗?

我已经检查了这个解决方案,但它不工作:

http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/7bdf431d-70db-419d-8e98-ef41cad8e2d8

解决方法

我不认为它使用ActiveX,因为在表中的onclick事件有一个简单的:
ReportFramerpvReport.GetReportFrame().contentwindow.print()

无论如何,我用我自己的打印功能替换了这个打印的东西,因为上面的代码不能在FF上工作

我知道这很丑,但它的作品! (只需用ControlID替换ControlName值,并确保在页面添加jQuery lib)

$(document).ready(function()
    {
        if ($.browser.mozilla)
        {
            try
            {
                var ControlName = 'RptDespesas';
                var innerScript = '<scr' + 'ipt type="text/javascript">document.getElementById("' + ControlName + '_print").Controller = new ReportViewerHoverButton("' + ControlName + '_print",false,"","#ECE9D8","#DDEEF7","#99BBE2","1px #ECE9D8 Solid","1px #336699 Solid","1px #336699 Solid");</scr' + 'ipt>';
                var innerTbody = '<tbody><tr><td><input type="image" style="border-width: 0px; padding: 2px; height: 16px; width: 16px;" alt="Print" src="/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;Version=9.0.30729.1&amp;Name=Microsoft.Reporting.WebForms.Icons.Print.gif" title="Print"></td></tr></tbody>';
                var innerTable = '<table title="Print" onmouSEOut="this.Controller.Onnormal();" onmouSEOver="this.Controller.OnHover();" onclick="PrintFunc(\'' + ControlName + '\'); return false;" id="' + ControlName + '_print" style="border: 1px solid rgb(236,233,216); background-color: rgb(236,216); cursor: default;">' + innerScript + innerTbody + '</table>'
                var outerScript = '<scr' + 'ipt type="text/javascript">document.getElementById("' + ControlName + '_print").Controller.Onnormal();</scr' + 'ipt>';
                var outerDiv = '<div style="display: inline; font-size: 8pt; height: 30px;" class=" "><table cellspacing="0" cellpadding="0" style="display: inline;"><tbody><tr><td height="28px">' + innerTable + outerScript + '</td></tr></tbody></table></div>';

                $("#" + ControlName + " > div > div").append(outerDiv);

            }
            catch (e) { alert(e); }
        }
    });

    function PrintFunc(ControlName)
    {
        setTimeout('ReportFrame' + ControlName + '.print();',100);
    }

相关文章

这篇文章主要讲解了“WPF如何实现带筛选功能的DataGrid”,文...
本篇内容介绍了“基于WPF如何实现3D画廊动画效果”的有关知识...
Some samples are below for ASP.Net web form controls:(fr...
问题描述: 对于未定义为 System.String 的列,唯一有效的值...
最近用到了CalendarExtender,结果不知道为什么发生了错位,...
ASP.NET 2.0 page lifecyle ASP.NET 2.0 event sequence cha...