C# .NET - Report viewer toolbar not working with firefox.

Asked By ruchi on 27-Apr-11 07:24 AM
Report viewer toolbar is working fine in IE.
But in firefox, print button is not visible and other buttons are not working.
TSN ... replied to ruchi on 27-Apr-11 07:31 AM
Hi..

If you are using Active-x control then
The ClientPrint control is based off of ActiveX and is not designed to work in none-IE browsers.
Riley K replied to ruchi on 27-Apr-11 07:33 AM
You have to include script to enable print in firefox, see below link
http:///

Also refer this link

http://www.eggheadcafe.com/community/aspnet/17/10291823/microsoft-report-viewer.aspx
Ravi S replied to ruchi on 27-Apr-11 07:34 AM
HI

try using ClientTarget="uplevel" in page directive

Let me know if any queries..
TSN ... replied to ruchi on 27-Apr-11 07:37 AM
Hi..
Here using Jquery in order to get the print functionality in firefox and chrome...

<asp:ImageButton ID="printButton" runat="server" ImageUrl="~/images/print1.gif" />
<script type="text/javascript" language="javascript">
 
var meid;
meid='<%=me.id%>';
  $_h(meid + '_printButton');  //set hide printButton
  var browseType;
 
  browseType = $_GB(); 
 
 if  (browseType != 'IE')
 {
 $_s(meid + '_printButton'); // If true show print button
var refTD = $_e('<%=me.actMControl%>_ctl01_ctl06_ctl00'); //Get refresh button in reportviewer control
var table=$_create(refTD.id + '_table1','table',refTD.parentNode.parentNode); //Create Table (A).. n put positon @ right refresh button
var tr=$_create(refTD.id + '_tr1','tr',table);  //create Table Row
var td=$_create(refTD.id + '_td1','td',tr);    //create Table Data
 
$_add(meid + '_printButton',td); // insert PrintButton in table (A)
 
 }
 
  </script>

$_add <--- this is my ajax


i use javascripts to inject "window.print()" in header of reportviewer... and its work in ff n chrome :D

target = reportViewer frame...

1 part of my ajax...


insertintoIFrame: function(target)    {
 
        if (typeof target === 'string')
       target= this.get(target); //Get iFrame
       
       var myDoc = target.contentWindow || target.contentDocument;
      if (myDoc.document) {
       myDoc = myDoc.document;
     }
      var  headLoc = myDoc.getElementsByTagName("head").item(0); // Get header in Iframe
      var scriptObj = myDoc.createElement("script");
     scriptObj.setAttribute("type", "text/javascript");
     scriptObj.innerHTML='window.print();'; //Put Print Command
     headLoc.appendChild(scriptObj);
      
     //then print windows will popup  =D
  }

Reena Jain replied to ruchi on 27-Apr-11 07:51 AM
hi,

here is a good link on this

http://blogs.msdn.com/b/webtopics/archive/2009/02/10/report-viewer-toolbar-does-not-render-properly-on-iis-7-0.aspx

Hope this will help you