Skip to content

Instantly share code, notes, and snippets.

@gjonespf
Created September 27, 2018 23:14
Show Gist options
  • Select an option

  • Save gjonespf/c01fe0b6b66a31c95f6cacccb59d8b39 to your computer and use it in GitHub Desktop.

Select an option

Save gjonespf/c01fe0b6b66a31c95f6cacccb59d8b39 to your computer and use it in GitHub Desktop.
ReportingServicesWebKitFix
// RS relies on some buggy IE functionality - that overflow should be visible by default (which is not standard)
// So Webkit based browsers don't show the report correctly as they hide overflow by default
// We need to set overflow visible for the report div
var deadman=60;
function makeReportVisible() {
if (typeof($) !== "undefined") {
var div = $('table[id*=_fixedTable] > tbody > tr:last > td:last > div')
if(div) {
div.css('overflow', 'visible');
}
}
}
// If jQuery is loaded, hook that up
if (typeof($) !== "undefined") {
$( document ).ready(function() {
makeReportVisible();
});
}
// Try to hook into our pageload sans any frameworks
if(window.attachEvent) {
window.attachEvent('onload', hookTryWireUp);
} else {
if(window.onload) {
var curronload = window.onload;
var newonload = function(evt) {
curronload(evt);
hookTryWireUp(evt);
};
window.onload = newonload;
} else {
window.onload = hookTryWireUp;
}
}
document.addEventListener("DOMContentLoaded", function(){
hookTryWireUp();
});
// Try to hook up our fix, once jQuery is loaded
function hookTryWireUp() {
if (typeof(Sys) !== "undefined") {
hookPRM();
return;
}
if (typeof($) !== "undefined") {
makeReportVisible();
return;
}
// Page could be still loading or having errors, try using a timer as a fallback
if(deadman > 0) {
deadman--;
setTimeout( function(){ hookTryWireUp(); }, 1000);
}
}
// Add into the PRM load sequence, if available
function hookPRM() {
if (typeof(Sys) !== "undefined") {
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm)
{
prm.add_pageLoaded(
function (sender, args) {
makeReportVisible();
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment