83

I have some simple reports in SSRS 2008 R2, but they won't display at all in Safari or Chrome. According to Microsoft's Books Online, these browsers are supported in limited fashion. However, I can't see anything after the data "Loading" clock completes. The parameter bar and bread crumb navigation section at the top of the page are all there. Also, I can Save/Export to any format on Safari and Chrome. It just won't display the report section itself, which is just blank.

Am I supposed to use certificates and secured connections (currently not setup with HTTPS, only HTTP)? Are there any server-side configurations that need to be tweaked? Has anyone had success displaying ANY reports on Safari/Chrome using previous SSRS versions (2005)?

I'm using Safari 5.0.4 and Chrome 10.0.648.151. I know the similarity for these two browsers is they both are based on WebKit.

The report renders successfully on Internet Explorer 8 (of course) and Firefox 4.0.

I would really appreciate it if someone can shed some light on this.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Greg H
  • 831
  • 1
  • 7
  • 4

17 Answers17

94

Ultimate solution (works in SSRS 2012 too!)

Append the following script to "C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js" (on the SSRS Server):

function pageLoad() {
    var element = document.getElementById("ctl31_ctl10");
    if (element)
    {
        element.style.overflow = "visible";
    }
}

Actually I don't know if the div's name is always ctl31_ctl10: in my case it is (instead over SQL Server 2012 azzlak found ctl32_ctl09).

If this solution doesn't work, look at the HTML from your browser to see if the script has worked properly changing the overflow:auto property to overflow:visible.


Solution for ReportViewer control

Insert this style line into the .aspx page (or into a linked .css file, if available):

#reportViewer_ctl09 {
  overflow:visible !important;
}

Reason

Chrome and Safari render overflow:auto in different way respect to Internet Explorer.

SSRS HTML is QuirksMode HTML and depends on IE 5.5 bugs. Non-IE browsers don't have the IE quirksmode and therefore render the HTML correctly

The HTML page produced by SSRS 2008 R2 reports contain a div which has overflow:auto style, and it turns report into an invisible report.

<div id="ctl31_ctl10" style="height:100%;width:100%;overflow:auto;position:relative;">
...</div>

Changing manually (using Chrome's debug window) final HTML overflow:auto in overflow:visible i can see reports on Chrome.

I love Tim's solution; it's easy and working.

But there is still a problem: Any time the user change parameters (my reports use parameters!) AJAX refreshes the div, the overflow:auto tag is rewritten, and no script changes it. This technote detail explains what is the problem.

This happens because in a page built with AJAX panels, only the AJAX panels change their state, without refreshing the whole page. Consequently, the OnLoad events you applied on the tag are only fired once: the first time your page loads. After that, changing any of the AJAX panels will not trigger these events anymore.

Mr.einarq suggested me the solution here.

Another option is to rename your function to pageLoad.

Any functions with this name will be called automatically by ASP.NET Ajax if it exists on the page, also after each partial update. If you do this you can also remove the onload attribute from the body tag

So I wrote the improved script that is shown in the solution.

Community
  • 1
  • 1
Emanuele Greco
  • 12,551
  • 7
  • 51
  • 70
  • Well hotdamn, I can confirm this working for me as well (SQL 2008 R2). – Vincent Vancalbergh Sep 18 '12 at 20:47
  • 3
    Also working in SSRS 2012. In my case the div has id "ctl31_ctl09". Thank you! – Chris Sep 19 '12 at 08:02
  • The solution provided by Emanuele worked for my but, I was having a problem viewing the report using the ReportViewer control on my aspx page. So I added some code on the aspx page. I've mentioned it [here](http://stackoverflow.com/a/12703330/494378) – Samir K Oct 03 '12 at 07:09
  • I'm unable to get the "pageLoad" event to fire, although I cut-and-pasted it into the bottom of the JS file indicated on my SSRS reporting server. Any suggestions about why that might not be going off? – Ben Finkel Oct 26 '12 at 02:38
  • @BenFinkel "pageLoad() is called after every UpdatePanel refresh" ( http://encosia.com/document-ready-and-pageload-are-not-the-same/ ) so maybe the problem is different.. try debug window of browser to see if text modified by you is linked and if there are Javascript errors. – Emanuele Greco Oct 26 '12 at 08:09
  • Thanks for the tips, I'll give those a whirl. I was able to get it working by putting the pageLoad script in my ASPX page with the ReportViewer control, but I could never get it to fire from the ReportingServices.js file. – Ben Finkel Oct 26 '12 at 14:13
  • not working in my case. I have created one div and then I have used report viewer control – Pedram Mar 25 '16 at 07:12
43

CSS-based Solution

I was able to add the following to the stylesheet for Reporting Services, and it fixed it for me in Chrome.

Disclaimer: This isn't thoroughly tested for cross-browser compatibility.

/**************CHROME BUG FIX*****************/
div#ctl31_ctl09,
div#ctl31_ctl10
{
    overflow: visible !important;
}
/*********************************************/

Add that to the beginning of the ReportingServices.css file.

For me, that file is located at:

C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\Styles\ReportingServices.css

Ryan
  • 2,948
  • 3
  • 30
  • 41
  • 3
    +1 works like a charm on all browsers (Chrome, Safari, IE9, IE10) tested. On MAC OS X Chrome the same... – YvesR Jun 27 '13 at 16:50
  • If you don't have access to the server to modify the css for all users, you can use the CSS in this answer with a browser extension like [Stylebot](https://chrome.google.com/webstore/detail/stylebot/oiaejidbmkiecgbjeifoejpgmdaleoha). – Mike Bockus Sep 22 '14 at 14:06
  • +1 Nice Solution! This is cheaper (performance wise) than fixing with Javascript and doesn't need to be updated every time the AJAX panel updates. – KyleMit Oct 28 '14 at 21:36
  • I was using the JS option that has much higher upvotes, then recently updated to the latest service pack(3). It stopped working for some reason, so I tried this. A+ works like a charm. – Isaac Fife Dec 16 '14 at 18:41
  • Just a note from the future as I recently ran into this issue. The fix worked after I adjusted the supplied CSS to be: div.ctl31_ctl09, div.ctl31_ctl10 instead of the pound signs. This was on a fresh SSRS 2008 R2 install. Maybe that is obvious but I don't really know CSS so I had to struggle with it a little bit. – Razzle Dazzle Oct 07 '15 at 21:18
  • 1
    wow! this was my problem, I just started to study SSRS R2 report deployment and it displays in IE but not in chrome. is there an explanation why is that? anyway, thanks Ryan! – Francis Saul Sep 03 '16 at 06:24
  • 1
    Mine were labeled as ctl32_ctl109 in SSRS 2012. After looking that up and using your CSS with my value, it worked perfectly. – Matt H Oct 21 '16 at 22:21
  • Works perfectly. We just moved from IE to Chrome firmwide and we were have issues until this fix! – Eric Apr 18 '18 at 14:56
18

This is a known issue. The problem is that a div tag has the style "overflow: auto" which apparently is not implemented well with WebKit which is used by Safari and Chrome (see Emanuele Greco's answer). I did not know how to take advantage of Emanuele's suggestion to use the RS:ReportViewerHost element, but I solved it using JavaScript.

Problem

enter image description here

Solution

Since "overflow: auto" is specified in the style attribute of the div element with id "ctl31_ctl10", we can't override it in a stylesheet file so I resorted to JavaScript. I appended the following code to "C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js"

function FixSafari()
{    
    var element = document.getElementById("ctl31_ctl10");
    if (element) 
    {
        element.style.overflow = "visible";  //default overflow value
    }
}

// Code from https://stackoverflow.com/questions/9434/how-do-i-add-an-additional-window-onload-event-in-javascript
if (window.addEventListener) // W3C standard
{
    window.addEventListener('load', FixSafari, false); // NB **not** 'onload'
} 
else if (window.attachEvent) // Microsoft
{
    window.attachEvent('onload', FixSafari);
}

Note

There appears to be a solution for SSRS 2005 that I have not tried but I don't think it is applicable to SSRS 2008 because I can't find the "DocMapAndReportFrame" class.

Community
  • 1
  • 1
Tim Partridge
  • 3,365
  • 1
  • 42
  • 52
7

CSS-based system-wide solution

This doesn't require any JavaScript or Ajax frames or any other wrapper. It was tested on Internet Explorer, Firefox, Safari and Chrome.

This can be fixed at the Style Sheet level in Report Server.

First, navigate to the directory where reporting services is installed, in my case (SQL Server 2012 SP1) it is:

C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer

In that directory, you will find a file named reportserver.config.

See Customize Style Sheets for HTML Viewer and Report Manager.

In that file insert a single XML line like (from the above document):

<Configuration>
...
          <HTMLViewerStyleSheet>SafariChromeFix</HTMLViewerStyleSheet>
...
</Configuration>

Save that.

What they don't tell you in the above link is that this entry overrides the default style sheet completely. My first attempts to get the reports to render worked by adding a div stylesheet, everything else was broken. Once I figured out that this edit to the reporserver.config file didn’t augment, but actually replaces the default style sheet, I copied in the default style sheet and everything started working.

Next, descend into the Styles directory (C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\Styles).

Make a copy the file named SP_Full.css and name the copy SafariChromeFix.css. At this point, SafariChromeFix.css should be identical to SP_Full.css.

Edit SafariChromeFix.css and add the following lines to the top:

div {
    overflow: visible !important;
}

Save it.

Once this is saved, all of the existing reports on this instance of Reporting Services will render on all browsers including Chrome and Safari.

Please Note:

It’s not only possible, but extremely likely that reportserver.config will be overwritten with updates to reporting services, so you may have to add the <HTMLViewerStyleSheet>SafariChrome</HTMLViewerStyleSheet> tag into it over time.

This also gives us a place to break into the default style sheet and make a lot of other custom changes starting from something that is already working. And since it's not the default stylesheet, your new custom CSS file doesn't get overwritten during upgrades and patches.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Gawain
  • 79
  • 1
  • 3
  • "Once this is saved, all of the existing reports on this instance of Reporting Services will render on all browsers including Chrome and Safari." - Yes, but they will still look horrible. – Stefan Steiger Aug 31 '15 at 12:01
4

My solution was to add the following <script> to:

Reporting Services\ReportManager\Pages\Report.aspx

The script targets the visible report content's parent1 and sets style.overflow:visible every time the report loads2 -including paging through a multipage report.

if (window.addEventListener && document.querySelector) window.addEventListener("load", function () {

    // drop out if Sys.Application.add_load is undefined
    if (!window.Sys || !Sys.Application || !Sys.Application.add_load) return;

    // register a function for when report data is loaded
    Sys.Application.add_load(function () {

        // get the report content control
        var n = document.querySelector("[id^=VisibleReportContent]");

        if (n) {

            // get the report content control's parent
            n = n.parentNode;

            if (n) {

                // revert overflow:hidden to "visible"
                n.style.overflow = "visible";

            }
        }

    });
});

1 This means we don't have to target generated ids which have a tendency to change, i.e.: ctl31_ctl09, ctl31_ctl10, ctl32_ctl09, etc.
2 See Sys.Application.add_load()

canon
  • 40,609
  • 10
  • 73
  • 97
  • 1
    This worked perfectly for me in in SSRS 2008 R2. It was a lifesaver for a Mac user of ours (who has no easy way to use IE.) – Lawson Mar 31 '15 at 16:04
4

In my case the offending DIV is "ctl31_ctl09" so if the above solution doesn't work for you try changing var element = document.getElementById("ctl31_ctl10"); to var element = document.getElementById("ctl31_ctl09");

animuson
  • 53,861
  • 28
  • 137
  • 147
Jabran Ali
  • 41
  • 1
2

For me the name was "ctl32_ctl09" (SSRS from SQL Server 2012 SP1, MSRS11).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Alexus1024
  • 447
  • 5
  • 7
2

I had to go into Chrome with F12 and noticed I had ctl32_ctl09, not ctl31_ctl09 in my div.

This is for Windows Server 2008 R2 64Bit with SQL Server 2012. Append the script and then restart SSRS and clear the browser cache.

//Fix to allow Chrome to display SSRS Reports

    function pageLoad() {
    var element = document.getElementById("**ctl32**_ctl09");
    if (element)
    {
        element.style.overflow = "visible";
    }
}
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user2585349
  • 71
  • 1
  • 1
2

The SQL Server 2014 release of Reporting Services adds support for the Google Chrome browser but there is no support for iOS yet. See details here.

Frank Goortani
  • 1,407
  • 17
  • 26
2

Unfortunately, the main answer breaks floating (position absolute) columns in Internet Explorer reports. Therefore, I slightly modified it, which I don't love since it's specifically looking for WebKit, but it's working:

//SSRS 2012 Chrome fix
function pageLoad() {
    var element = document.getElementById("ctl32_ctl09");
    var isWebKit = !!window.webkitURL;    // Chrome or safari really (WebKit browsers).
    // We don't want to do this fix in Internet Explorer, because it breaks floating columns
    if (element && isWebKit)
    {
        element.style.overflow = "visible";
    }
}
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
archangel76
  • 1,544
  • 2
  • 11
  • 18
1

The problem still exists in Chrome 22.0.1229.79.

YMMV, but I have found that removing height from the ReportViewer tag fixes this issue.

I was having this issue with SSAS reports, but not the SSRS ones. I couldn't figure out why until I checked the differences in the pages (a consultant had done the SSAS reports). He was setting ReportViewer Height=60% and the SSRS reports were not specifying the height.

Once I removed Height, my reports displayed.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
fujiiface
  • 1,262
  • 11
  • 15
1

For SSRS 2012 on Windows Server 2008 R2 x64, a working script is:

function pageLoad()
{
    var element = document.getElementById("ctl31_ctl09");
    if (element)
    {
        element.style.overflow = "visible";
    }

    if (window.addEventListener) // W3C standard
    {
         window.addEventListener('load', FixSafari, false); // NB **not** 'onload'
    }
    else
        if (window.attachEvent) // Microsoft
        {
            window.attachEvent('onload', FixSafari);
        }
}

function FixSafari()
{
    var element = document.getElementById("ctl31_ctl09");
    if (element)
    {
        element.style.overflow = "visible";  // Default overflow value
    }
}

All the suggested above versions were not working at all.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
1

To get around having to hardcode the element ID, I edited the ReportingServices.js file on the RS server @ [Drive]:\Program Files\Microsoft SQL Server\[Reporting Services Instance]\Reporting Services\ReportManager\js\ReportingServices.js to include some code to fetch jQuery, load it into the page, and then find all elements where overflow is set to auto.

Insert the following code at the top of the ReportingServices.js file

var loadjQuery = function (cb) {
    if (typeof (jQuery) == 'undefined') {
        var scr = document.createElement('script');
        scr.setAttribute('type', 'text/javascript');
        scr.setAttribute('src', 'http://code.jquery.com/jquery-latest.js');

        if (scr.readyState) {
            scr.onreadystatechange = function () {
                if (scr.readyState === 'complete' || scr.readyState === 'loaded') {
                    scr.onreadystatechange = null;
                    if (typeof (cb) === 'function') {
                        args = [].slice.call(arguments, 1);
                        cb.apply(this, args);
                    }
                }
            };
        }
        else {
            scr.onload = function () {
                if (typeof (cb) === 'function') {
                    args = [].slice.call(arguments, 1);
                    cb.apply(this, args);
                }
            };
        }

        var head = document.getElementsByTagName('head')[0];
        head.insertBefore(scr, head.firstChild);
    }
}

Then the next line after that is what was originally in the JS file.

After that, add the following code

var _rmFixReady = false;
function pageLoad() {
    loadjQuery(function () {
        _rmFixReady = true;
    });
    if (_rmFixReady) {
        var overflowElements = $('div').filter(function () { return $(this).css('overflow') == 'auto'; });
        overflowElements.each(function () {
            $(this).css('overflow', 'visible');
        });
    }
}

I just finished testing this with Chrome 27 and IE 10 on a RM2012 instance and it worked great.

Mike Pugh
  • 6,787
  • 2
  • 27
  • 25
1

One problem with the overflow:visible fix is that floating headers are broken across all browsers. The following script will leave Internet Explorer alone and apply the fix only to non-Internet Explorer browsers. With this, all functionality is retained for Internet Explorer users and other browsers can still view the reports.

function pageLoad() {
    var eval = getInternetExplorerVersion();
    if (eval == -1)
    {
        var element = document.getElementById("ctl31_ctl09");
        if (element)
        {
            element.style.overflow = "visible";
        }
    }
}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer')
    {
        var ua = navigator.userAgent;
        var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat( RegExp.$1 );
    }
    return rv;
}
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
ant_iw3r
  • 222
  • 1
  • 2
  • 10
1

I tried the approaches and it worked for me, but our system administrators were skeptical about these change.

Instead of setting height to 100% on the ReportViewer, I used a fixed height, and it managed to work in my application for Internet Explorer and Chrome.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
AsitK
  • 651
  • 1
  • 4
  • 14
1

I had the same problem with viewing repports on Chrome. I fixed it by adding the extension "SSRS Report Fix" to Google Chrome. https://chrome.google.com/webstore/detail/ssrs-report-fix/fjbdfjiheheafbioiejbdpalmojkeobk

user3328049
  • 91
  • 2
  • 4
1

I've never had any luck with displaying reports in Chrome. Most of Microsoft's documentation doesn't even list it so I assume Chrome must have trouble interpreting something in the ASP.

See Browser Support for Reporting Services and Power View.

I'm running Chrome 11 and experience the same behavior as you.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ryan
  • 279
  • 1
  • 10