Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Disabled Right Click in SSRS

Author  Topic 

micnie_2020
Posting Yak Master

232 Posts

Posted - 2012-03-19 : 03:09:55
Dear All,


How can i add in Javascript disable right click as below into .rdl report or any method in SSRS i can disable right click or select all, this is to avoid copy & paste function:-

<script language="JavaScript">

var message="Sorry, No Right Click Allowed!!!";

function clickIE6(){

if (event.button==2){

alert(message);

return false;

}

}

function clickNS4(e){

if (document.layers||document.getElementById&&!document.all){

if (e.which==2||e.which==3){

alert(message);

return false;

}

}

}

if (document.layers){

document.captureEvents(Event.MOUSEDOWN);

document.onmousedown=clickNS4;

}

else if (document.all&&!document.getElementById){

document.onmousedown=clickIE6;

}

document.oncontextmenu = new Function("alert(message);return false");

</script>


Please Advise.

Thank you
   

- Advertisement -