Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't think it uses ActiveX, because in the table onclick event there is a simple:</p> <pre><code>ReportFramerpvReport.GetReportFrame().contentWindow.print() </code></pre> <p>Anyway, i replaced this print stuff with my own print function, because this code above wasn't working on FF..</p> <p>I know it's ugly...but it works! (just replace the ControlName value with your ControlID and be sure to add jQuery lib in your page)</p> <pre><code> $(document).ready(function() { if ($.browser.mozilla) { try { var ControlName = 'RptDespesas'; var innerScript = '&lt;scr' + 'ipt type="text/javascript"&gt;document.getElementById("' + ControlName + '_print").Controller = new ReportViewerHoverButton("' + ControlName + '_print", false, "", "", "", "#ECE9D8", "#DDEEF7", "#99BBE2", "1px #ECE9D8 Solid", "1px #336699 Solid", "1px #336699 Solid");&lt;/scr' + 'ipt&gt;'; var innerTbody = '&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;input type="image" style="border-width: 0px; padding: 2px; height: 16px; width: 16px;" alt="Print" src="/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;amp;Version=9.0.30729.1&amp;amp;Name=Microsoft.Reporting.WebForms.Icons.Print.gif" title="Print"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;'; var innerTable = '&lt;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;"&gt;' + innerScript + innerTbody + '&lt;/table&gt;' var outerScript = '&lt;scr' + 'ipt type="text/javascript"&gt;document.getElementById("' + ControlName + '_print").Controller.OnNormal();&lt;/scr' + 'ipt&gt;'; var outerDiv = '&lt;div style="display: inline; font-size: 8pt; height: 30px;" class=" "&gt;&lt;table cellspacing="0" cellpadding="0" style="display: inline;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td height="28px"&gt;' + innerTable + outerScript + '&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;'; $("#" + ControlName + " &gt; div &gt; div").append(outerDiv); } catch (e) { alert(e); } } }); function PrintFunc(ControlName) { setTimeout('ReportFrame' + ControlName + '.print();', 100); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload