SSRS: reports blank in Chrome, but work on Firefox/IE - reporting-services

A strange behavior: if a try to open my reports on the SSRS from a Chrome browser I have a blank page (it just appears the upper bar with the reports' field) while if opening the same using Firefox or Internet Explorer, rendering is performed fine.
I retrieved following solution to append following code:
function pageLoad() {
var element = document.getElementById("ctl31_ctl10");
if (element)
{
element.style.overflow = "visible";
}
}
on the C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js file.
I tried to put both ctl31_ctl10 or ctl31_ctl09 as suggested, all the time also stopping and restarting SSRS services and re-opening chrome browser, but still having this issue.
SSRS version: 11.0.5058.0
SQL Server 2012
Does anybody know a solution for that?
thanks

Fixed appending to C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js:
function initJQuery() {
//if the jQuery object isn't available
if (typeof(jQuery) == 'undefined') {
if (! jQueryScriptOutputted) {
//only output the script once..
jQueryScriptOutputted = true;
//output the script
document.write("<scr" + "ipt type=\"text/javascript\" src=\"../js/jquery-1.6.2.js\"></scr" + "ipt>");
}
setTimeout("initJQuery()", 50);
} else {
$(function() {
// Bug-fix on Chrome and Safari etc (webkit)
if ($.browser.webkit) {
// Start timer to make sure overflow is set to visible
setInterval(function () {
var div = $('table[id*=_fixedTable] > tbody > tr:last > td:last > div')
div.css('overflow', 'visible');
}, 1000);
}
});
}
}
initJQuery();
This also requires to download jquery-1.6.2.js on the same folder as suggested here: https://stackoverflow.com/a/12501264/5449321

Related

Why is my code working in Firefox (Greasemonkey) but not in Chrome (Tampermonkey)?

I have used some code to automatically follow someone on Instagram in Greasemonkey but when I try it in Tampermonkey in Chrome I get a symbol with an exclamation mark saying 'filterArrButtons' is not defined.
Here is the code
window.addEventListener('DOMContentLoaded', function() {
setInterval(function() {
var btns = document.getElementsByClassName("_5f5mN");
for (var i = 0; i < btns.length; i++) {
if (btns[i].innerHTML == "Follow") {
btns[i].click();
}
}
for (var x = 0; x <= filterArrButtons.length - 1; x++) {
var df = filterArrButtons[x].classList;
df = df.value.split(" ");
simulateCliks(filterArrButtons[x], "click");
}
}, 2000);
});
function simulateCliks(el, evntType) {
if (el.fireEvent) {
el.fireEvent('on' + evntType);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(evntType, true, false);
el.dispatchEvent(evObj);
}
}
});
And here is a screenshot of the error I'm getting
enter image description here
I've tried searching for an answer to the problem I'm getting but I can't find anything. It works in Greasemonkey on Firefox but not in Tampermonkey in Chrome.
run-at
GreaseMonkey and ViolentMonkey defaults to 'document-end' while the Firefox content_scripts default run-at is 'document_idle' and so does FireMonkey and TamperMonkey.
GreaseMonkey document-end
ViolentMonkey document-end
FireMonkey document-idle
TamperMonkey document-idle
document-idle in TamperMonkey means that script is injected AFTER 'DOMContentLoaded', therefore 'DOMContentLoaded' will never fire the event.
The complete script is not shown so it is unclear if run-at is set or left as default.

Offline Ready using Service worker

I built an offline first app using the appcache a while ago and wanted to convert it to using the service-worker (my clients all use the latest chrome so I don't have any browser compatibility issues).
I'm using sw-precache to generate a service-worker that caches my local assets (specifically, my html/css/fonts and also some js) and it looks like when the service-worker installs, it does successfully add all the assets to cache storage and it does successfully start (install and activate both fire and complete successfully. And I have the self.skipWaiting() at the end of the install event to start the service-worker (which it does successfully as well)).
The issue is that the "fetch" event doesn't seem to ever fire. As such, if I go offline or open a browser (while already offline) and navigate to the site, I get the Chrome offline dinosaur. When I look at the network tab, it looks like the browser is trying to hit a server to retrieve the pages. I'm not sure what I'm doing wrong and I didn't touch the fetch method that was generated by the sw-precache utility...so I'm not sure what I'm missing. Any help would be greatly appreciated. My fetch event is below:
self.addEventListener('fetch', function(event) {
if (event.request.method === 'GET') {
var urlWithoutIgnoredParameters = stripIgnoredUrlParameters(event.request.url,
IgnoreUrlParametersMatching);
var cacheName = AbsoluteUrlToCacheName[urlWithoutIgnoredParameters];
var directoryIndex = 'index.html';
if (!cacheName && directoryIndex) {
urlWithoutIgnoredParameters = addDirectoryIndex(urlWithoutIgnoredParameters, directoryIndex);
cacheName = AbsoluteUrlToCacheName[urlWithoutIgnoredParameters];
}
var navigateFallback = '';
// Ideally, this would check for event.request.mode === 'navigate', but that is not widely
// supported yet:
// https://code.google.com/p/chromium/issues/detail?id=540967
// https://bugzilla.mozilla.org/show_bug.cgi?id=1209081
if (!cacheName && navigateFallback && event.request.headers.has('accept') &&
event.request.headers.get('accept').includes('text/html') &&
/* eslint-disable quotes, comma-spacing */
isPathWhitelisted([], event.request.url)) {
/* eslint-enable quotes, comma-spacing */
var navigateFallbackUrl = new URL(navigateFallback, self.location);
cacheName = AbsoluteUrlToCacheName[navigateFallbackUrl.toString()];
}
if (cacheName) {
event.respondWith(
// Rely on the fact that each cache we manage should only have one entry, and return that.
caches.open(cacheName).then(function(cache) {
return cache.keys().then(function(keys) {
return cache.match(keys[0]).then(function(response) {
if (response) {
return response;
}
// If for some reason the response was deleted from the cache,
// raise and exception and fall back to the fetch() triggered in the catch().
throw Error('The cache ' + cacheName + ' is empty.');
});
});
}).catch(function(e) {
console.warn('Couldn\'t serve response for "%s" from cache: %O', event.request.url, e);
return fetch(event.request);
})
);
}
}
});

Is there any way to Disable span tag in Dynamics Crm 2013

Can we Disable Span tag in dynamics crm 2013.is there anyways to disable span tag. i tried the below code
function disableSubgrid()
{
debugger;
var subgrid=document.getElementById("Contacts_span").disabled=true;
}
I'm not sure what your code does but it has wrong syntax anyway. Should be something like:
function disableSubgrid()
{
var subgrid=document.getElementById("Contacts_span");
if (subgrid != null){
subgrid.disabled = true;
}
}

WebRTC SDP object (local description) by Firefox does not contain DataChannel info unlike Chrome?

I'm testing WebRTC procedure step by step for my sake.
I wrote some testing site for server-less WebRTC.
http://webrtcdevelop.appspot.com/
In fact, STUN server by google is used, but no signalling server deployed.
Session Description Protocol (SDP) is exchanged manually by hand that is CopyPaste between browser windows.
So far, here is the result I've got with the code:
'use strict';
var peerCon;
var ch;
$(document)
.ready(function()
{
init();
$('#remotebtn2')
.attr("disabled", "");
$('#localbtn')
.click(function()
{
offerCreate();
$('#localbtn')
.attr("disabled", "");
$('#remotebtn')
.attr("disabled", "");
$('#remotebtn2')
.removeAttr("disabled");
});
$('#remotebtn')
.click(function()
{
answerCreate(
new RTCSessionDescription(JSON.parse($('#remote')
.val())));
$('#localbtn')
.attr("disabled", "");
$('#remotebtn')
.attr("disabled", "");
$('#remotebtn')
.attr("disabled", "");
});
$('#remotebtn2')
.click(function()
{
answerGet(
new RTCSessionDescription(JSON.parse($('#remote')
.val())));
$('#remotebtn2')
.attr("disabled", "");
});
$('#msgbtn')
.click(function()
{
msgSend($('#msg')
.val());
});
});
var init = function()
{
//offer------
peerCon =
new RTCPeerConnection(
{
"iceServers": [
{
"url": "stun:stun.l.google.com:19302"
}]
},
{
"optional": []
});
var localDescriptionOut = function()
{
console.log(JSON.stringify(peerCon.localDescription));
$('#local')
.text(JSON.stringify(peerCon.localDescription));
};
peerCon.onicecandidate = function(e)
{
console.log(e);
if (e.candidate === null)
{
console.log('candidate empty!');
localDescriptionOut();
}
};
ch = peerCon.createDataChannel(
'ch1',
{
reliable: true
});
ch.onopen = function()
{
dlog('ch.onopen');
};
ch.onmessage = function(e)
{
dlog(e.data);
};
ch.onclose = function(e)
{
dlog('closed');
};
ch.onerror = function(e)
{
dlog('error');
};
};
var msgSend = function(msg)
{
ch.send(msg);
}
var offerCreate = function()
{
peerCon
.createOffer(function(description)
{
peerCon
.setLocalDescription(description, function()
{
//wait for complete of peerCon.onicecandidate
}, error);
}, error);
};
var answerCreate = function(descreption)
{
peerCon
.setRemoteDescription(descreption, function()
{
peerCon
.createAnswer(
function(description)
{
peerCon
.setLocalDescription(description, function()
{
//wait for complete of peerCon.onicecandidate
}, error);
}, error);
}, error);
};
var answerGet = function(description)
{
peerCon.setRemoteDescription(description, function()
{ //
console.log(JSON.stringify(description));
dlog('local-remote-setDescriptions complete!');
}, error);
};
var error = function(e)
{
console.log(e);
};
var dlog = function(msg)
{
var content = $('#onmsg')
.html();
$('#onmsg')
.html(content + msg + '<br>');
}
Firefox(26.0):
RtpDataChannels
onopen event is fired successfully, but send fails.
Chrome(31.0):
RtpDataChannels
onopen event is fired successfully, and send also succeeded.
A SDP object by Chrome is as follows:
{"sdp":".................. cname:L5dftYw3P3clhLve
\r\
na=ssrc:2410443476 msid:ch1 ch1
\r\
na=ssrc:2410443476 mslabel:ch1
\r\
na=ssrc:2410443476 label:ch1
\r\n","type":"offer"}
where the ch1 information defined in the code;
ch = peerCon.createDataChannel(
'ch1',
{
reliable: false
});
is bundled properly.
However, a SDP object (local description) by Firefox does not contain DataChannel at all, and moreover, the SDP is much shorter than Chrome, and less information bundled.
What do I miss?
Probably, I guess the reason that send fails on DataChannel is due to this lack of information in the SDP object by firefox.
How could I fix this?
I investigated sources of various working libraries, such as peerJS, easyRTC, simpleWebRTC, but cannot figure out the reason.
Any suggestion and recommendation to read is appreciated.
[not an answer, yet]
I leave this here just trying to help you. I am not much of a WebRTC developer. But, curious i am, this quite new and verry interresting for me.
Have you seen this ?
DataChannels
Supported in Firefox today, you can use DataChannels to send peer-to-peer
information during an audio/video call. There is
currently a bug that requires developers to set up some sort of
audio/video stream (even a “fake” one) in order to initiate a
DataChannel, but we will soon be fixing that.
Also, i found this bug hook, witch seems to be related.
One last point, your version of adapter.js is different from the one served on code.google. And .. alot. the webrtcDetectedVersion part is missing in yours.
https://code.google.com/p/webrtc/source/browse/stable/samples/js/base/adapter.js
Try that, come back to me with good newz. ?
After last updating, i have this line in console after clicking 'get answer'
Object { name="INVALID_STATE", message="Cannot set remote offer in
state HAVE_LOCAL_OFFER", exposedProps={...}, more...}
but this might be useless info ence i copy pasted the same browser offre to answer.
.. witch made me notice you are using jQuery v1.7.1 jquery.com.
Try updating jQuery (before i kill a kitten), and in the meantime, try make sure you use all updated versions of scripts.
Woups, after fast reading this : https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC/WebRTC_basics then comparing your javascripts, i see no SHIM.
Shims
As you can imagine, with such an early API, you must use the browser
prefixes and shim it to a common variable.
> var PeerConnection = window.mozRTCPeerConnection ||
> window.webkitRTCPeerConnection; var IceCandidate =
> window.mozRTCIceCandidate || window.RTCIceCandidate; var
> SessionDescription = window.mozRTCSessionDescription ||
> window.RTCSessionDescription; navigator.getUserMedia =
> navigator.getUserMedia || navigator.mozGetUserMedia ||
> navigator.webkitGetUserMedia;

Dragging a local file into textarea with Opera 12

I am creating an application using HTML5 where I would like to be able to drag a local text file into a textarea. This works fine in Firefox 20.0.1, Chrome 26.0.1410.64 m and Internet Explorer 10 but not in Opera 12.15 or Safari 5.1.7. Instead of the text of the file appearing within the text area a new page opens containing the text. I understand from this answer that I should expect problems from Safari however the implication is that it should work with Opera 12.
Any help explaining or overcoming the problem would be appreciated.
The application, which is nowhere near finished, is at grideasy.github.io with the source files at https://github.com/grideasy/grideasy.github.io
To see the effect click on the 'Content' button and drag a text file into the text area.
Both Safari and Opera pass the detect feature code below
if(window.File && window.FileReader && window.FileList && window.Blob) {
dropZone = $('drop_zone');
dropZone.value="";
dropZone.addEventListener('dragover', handleDragOver, false);
dropZone.addEventListener('drop', handleFileSelect, false);
dropZone.addEventListener('click', storeCursorPosition, false);
dropZone.addEventListener('keyup', storeCursorPosition, false);
}
else {
}
this is found in lines 30 to 41 of the event.js file
The following code from dropcontent.js reads the file and displays the text from the file.
function handleDragOver(evt) {
evt.stopPropagation();
evt.preventDefault();
}
function handleBodyDrop(evt) {
evt.stopPropagation();
evt.preventDefault();
}
function handleFileSelect(evt) {
evt.stopPropagation();
evt.preventDefault();
var files = evt.dataTransfer.files; // FileList object.
var f = files[0];
if (f)
{
var r = new FileReader();
r.onloadend = function(e) {extract(e.target.result) }
r.readAsText(f);
}
else
{
alert("Failed to load file");
}
}
function extract(a) {
$('drop_zone').value=a;
}
Thank you for any suggestions
It appears that Opera will not accept a textarea as an object that can be used as a dropzone. Changing the textarea to a paragraph, span or div will allow that area to accept a draged and dropped file.