ReportViewer control toolbar in Google Chrome browser

13. August 2009

SQL Server Reporting Services ReportViewer control has a toolbar that is not displayed correctly in Google Chrome browser. You will see something like this:

 

 The correct display looks like this:

 

A workaround I'm using is to use JavaScript to find DIV and TABLE elements in the above toolbar and change their "display" style to "inline-block".

Following code can be added to the bottom of the page to accomplish this:

onode = document.getElementById("ReportViewer1_ctl00").nextDivObject();
for (var i = 0; i < onode.childNodes.length; i++) {
    if (onode.childNodes[i].nodeType == 1) {
        for (var j = 0; j < onode.childNodes[i].childNodes.length; j++) {
            if (onode.childNodes[i].childNodes[j].nodeType == 1) {
                onode.childNodes[i].childNodes[j].style.display = "inline-block";
            }
        }
    }
}

 
 
The nextDivObject() function is defined in the HEAD section of the page:
 

Object.prototype.nextDivObject = function() {
    var n = this;
    do n = n.nextSibling;
    while (n && n.nodeType != 1 && n.nodeName != "DIV");
    return n;
}

Currently rated 4.2 by 5 people

  • Currently 4.2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Chrome, ReportViewer ,

Comments