Focal Point
How to disable view source on the report.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6051056681

September 19, 2006, 05:20 PM
newtofocus
How to disable view source on the report.
I have a drillable report that is produced by calling a fex through a launch page. I want to disable the right click function on the report.

I have the javascript code to disable a right click in the launch page. How do I make it propagate to the report.

Thanks


WF7.1.4 Prod/Test, MRE, self serve, DM
September 19, 2006, 05:38 PM
Francis Mariani
TABLE FILE CAR
PRINT *
WHERE READLIMIT EQ 100
WHERE RECORDLIMIT EQ 100
HEADING
" "
ON TABLE HOLD AS H001 FORMAT HTMTABLE
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF,
FONT='ARIAL', SIZE=8, $
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<HTML>
<HEAD>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
//YOUR JAVASCRIPT HERE
</SCRIPT>
</HEAD>

<BODY>
!IBI.FIL.H001;
</BODY>
</HTML>
-HTMLFORM END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 20, 2006, 10:25 AM
Kamesh
You can try this way too,

SET JSURL=/ibi_html/killmenu.js
TABLE FILE CAR
SUM DEALER_COST
BY COUNTRY
END
-EXIT

Save the javascript under ibi_html directory.
killmenu.js
-----------
function setnocontextclick () {
if (document.body != null) {
document.body.oncontextmenu=new Function("return false");
}else window.setTimeout("setnocontextclick()",100);
}

function killmenuOnLoadFunc(arrayofonloads,currentindex) {
setnocontextclick();
}


WFConsultant

WF 8105M on Win7/Tomcat
September 20, 2006, 11:06 AM
Tony A
Javascript methods are fine when preventing context menu access to view source but you would also have to ensure that the browser window does not have the menu item to view source and also that the end user can not add it to their toolbar.

Or ....

Just output everything in XML with XSL styling. That way there is no source to view.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 20, 2006, 12:53 PM
newtofocus
Hi,

I was able to disable right click through the following code. Can some one provide me javascript function that would prevent the view menu option from the screen appearing.

TABLE FILE CAR
PRINT *
END
-HTMLFORM BEGIN
<script TYPE="text/javascript" LANGUAGE="JavaScript">
var message = "function disabled";
function rtclickcheck(keyp)
{
if (navigator.appName == "Netscape" && keyp.which == 3)
{ 	alert(message); 	return false;
}
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2)
{ 	alert(message); 	return false;
}
}
document.onmousedown = rtclickcheck;

</SCRIPT>
<HTML>
<HEAD>
</HEAD>
</HTML>
-HTMLFORM END 

This message has been edited. Last edited by: Kerry,


WF7.1.4 Prod/Test, MRE, self serve, DM