Print button of ssrs report in Mozilla firefox

Con risposta Print button of ssrs report in Mozilla firefox

  • giovedì 12 aprile 2012 06:23
     
     

    Hi all,

        I am using VS2008 and ms sql server2008, i create a ssrs report. it run in Firefox, the print button is not shown here, but it run in IE the print button is shown.

        Any possibility to show the print button of ssrs report in Firefox.  I search this problem , but didn't get any solution to solve this problem. Any other option to show print button in Firefox to print that report.

        Anyone has any idea, please help me....

        Thanks for reply...

Tutte le risposte

  • lunedì 16 aprile 2012 20:02
     
     

    Hi Rose,

    Print makes use of an Active X control, which is not supported in Firefox. To get Print in Firefox, export to PDF then print or implement your own Print functionality


    Brad Syputa, Microsoft Reporting Services This posting is provided "AS IS" with no warranties.

  • venerdì 27 aprile 2012 06:15
     
     Con risposta Contiene codice

    Hi all,

    Got the solution, use the Following scripts, here replace the variable "ControlName" with the name of ReportViewer used.

    <script type="text/javascript" src="lib/jquery.js"></script>
        <script type="text/javascript" language="javascript">
            $(document).ready(function() {
                if ($.browser.mozilla ) {
                    try {
                        var ControlName = 'ReportViewer1';
                        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, 233, 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);
            }
        </script>

    Thanks to all ....


    • Contrassegnato come risposta rose chandu venerdì 27 aprile 2012 06:16
    • Modificato rose chandu venerdì 27 aprile 2012 06:19
    • Modificato rose chandu venerdì 27 aprile 2012 06:22
    • Modificato rose chandu venerdì 27 aprile 2012 06:23
    • Modificato rose chandu venerdì 27 aprile 2012 06:25
    •  
  • lunedì 19 novembre 2012 17:44
     
     
    Has this solution worked for another person? I can't get it working on my project. I am using VS2010.
    • Modificato Ntanta lunedì 19 novembre 2012 18:32
    •