Wednesday, 8 February 2012

SSRS 2008 R2 - Reports are blank on Chrome

There is a frustrating issue with SQL 2008 R2 Reporting Services when rendering on Chrome (and Safari) - in that they simply display a completely blank screen.

After eventually convincing the users in question that it wasn't SQL's fault, or a problem with the report definition, since they displayed fine on internet explorer, I set about tracking down a fix.

There doesn't seem to be a lot of documentation out there on this problem at the moment, and the only place I found anything helpful was here: StackOverflow

Basically though, you need to update the ReportingServices.js file on the report server, as Chrome & Safari render a certain type of element in a slightly different way to IE.

FIX

Connect to your Reporting Services server, and find the relevant ReportingServices.js file - this will probably be somewhere like "C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js", or on a 64 bit machine, "C:\Program Files (x86)\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js"

First up, take a copy of this file - let's not be silly here and assume this is a 100% foolproof solution!

Next, edit this file in notepad. Do a quick search for PageLoad, to ensure no-one else has already hacked applied this fix, then jump to the bottom of the existing text.

Simply append the following code:
function pageLoad() {
var element = document.getElementById("ctl31_ctl10");
if (element)
{
element.style.overflow = "visible";
} }

Save the file, and restart Reporting Services - you should now find that Chrome displays your reports again.

ADDITIONAL - if you have a problem getting reports to show up on IE 10 on Windows 8, it may be this fix you need instead:  SSRS Reports blank on Windows 8

UPDATE: the following combination of ctl codes seems to work on later versions :

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

21 comments:

SQL Ninja said...

What about SQL 2012 because the above solution didn't work?

Thanks

Grumpy DBA said...

To be honest, it didn't work when I tried it yesterday on a SQL 2008 R2 installation either - was showing a div id element of ctl31_ctl09 in the html source code, but changing the above code to that didn't work either.

I'm continuing to investigate though ...

Dr Fumunchu said...

Hey Guys,

Found that when i use Safari Or Chrome I get the exact same problem, even after adding the the jQuery function. So I created a ASP page with the report viewer control on it, and referenced my SSRS server. And it worked.... It displays in Chrome and safari. I am happy to share my code if required, just drop me a mail.

jacques_bronkhorst@yahoo.com

Anonymous said...

help... please post your code if you can

Dr. Fumunchu

Adi Sapir said...

I've just managed to have my 2012 Reporting services run smooth on Chrome/Safari etc...
Used this ref: http://stackoverflow.com/questions/5428017/cannot-view-ssrs-2008-r2-reports-in-safari-chrome-but-works-fine-in-firefox-ie8

Note that you need to view the source of one of the "invisible" reports to get the tag right (in my case it was ctl31_ctl09 instead of ctl31_ctl10)

Adi // www.doccolabs.com

Anonymous said...

Muchas gracias me sirvio a la perfeccion.....me salvaste.

Saludos

Anonymous said...

Remember to clear your browser cache after making the change or it won't take effect.

Grumpy DBA said...

Note there is another post which addresses a similar issue with IE 10 not showing reports in Windows 8:
http://grumpydba.blogspot.co.uk/2013/09/ssrs-reports-blank-in-windows-8.html

Anonymous said...

Hello all,

I can't get this to work consistently on Windows 8 for IE 10. What's odd is that the reports display fine on our dev server but not on our production server (SSRS on SQL Server 2008 R2). I was even able to use the JavaScript pageLoad() function to fix the display for Chrome. And the reports also work on IE 11 in Windows 7. But reports on IE 10 on Windows 8 still come up blank for us on SSRS 2008 R2.

But I can't figure out what is different between the servers that is causing the discrepancy. I was able to get both servers to display reports using the IE Compatibility View, but that's not a real resolution because it doesn't explain why the reports are currently behaving differently when the IE 10 browser is not in Compatibility View. Does anyone have any advice on how to get both servers back in synch again, preferably with reports showing in both?

Thanks for any help.

Anonymous said...

PS Regarding my comment just posted - I did change things on each server at different times and unfortunately don't have a complete log of those changes. I'm hoping there is a way to compare the dev and production instances to sort out this problem, but I just wanted to add the information about having made changes so that people don't think the two servers just spontaneously started behaving differently. At this point I am trying to track down and synchronize the differences. Thanks again.

Anonymous said...

I have this issue as well. I appended the .js script but when I view the source in chrome there is an error message embedded in the code that says it is missing the report viewer 10 reference in the config file. When I add this reference I get a config error and the app will not run at all...This is on vs 2008 and sql 2008 r2 web edition...

Goran Borojevic said...

I updated the script for both ctl31_ctl10 and ctl31_ctl09 no luck. My issue is with SSRS 2005. Any other ideas? I searched everywhere.

Goran Borojevic said...

Clearly I was NOT following instructions. So let me clear this up for anyone confused. The update needs to be performed on the machine where the SSRS web service is running and NOT on the SQL server box. In some cases this may or may not be the same server in my case this was NOT the case. I am not sure if the js file needs to be updated on Both servers in that case.

Anonymous said...

for 2012 use this:

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

Anonymous said...

The problem with all of this is that it breaks the floating headers in all browsers. This "fix" is a bandage for one problem that creates another.

Anonymous said...

thanx to the Anonymous that say:
member to clear your browser cache after making the change or it won't take effect.
after patching the ReportingServices.js

this is important !!! and now it works for me !

Anonymous said...

Thanks for the last comment about the browser cache, that's what worked for me

Grumpy DBA said...

This combination of ctl codes sometimes seems to work as well if the above doesn't work:

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

Unknown said...

I can't find reportingservices.js for SQL Server 2016.

Unknown said...

I can't find reportingservices.js for SQL Server 2016.

Anonymous said...

SAME: I can't find reportingservices.js for SQL Server 2016.

Post a Comment