Browsing "Older Posts"

APEX-AT-WORK no image

Run an executable file from your browser

Von Tobias Arnhold → 4.23.2010
Internet Explorer is the only browser which can run executable files. I don't know any other browser which supports this feature. Of course there are common reason why! With IE you need to use VBScript. As we all know it is not secure way of developing web application. So be careful in creating security rules inside your Internet Explorer.

This code shows two examples:

<HTML>
<HEAD>
</HEAD>
<BODY>

<SCRIPT language = "vbscript">
'define application
dim v_prog

'set command
v_prog = "C:\Programme\7-Zip\7zFM.exe"

'create a shell
set v_shell = createobject("wscript.shell")

'run application
v_shell.run(v_prog)
</SCRIPT>

<SCRIPT language = "vbscript">
'set variables
dim v_shell
dim v_return
dim v_prog

'set command
v_prog = "%SystemRoot%\system32\ping 192.168.0.1"

'create a shell
set v_shell = CreateObject("WScript.Shell")

'run application
v_return = v_shell.Run(v_prog,1,TRUE)

'check return value
if v_return = 0 then
MsgBox "Server is up",64,"Server status"
else
MsgBox "Server is down",64,"Server status"
end if
</SCRIPT>

</BODY>
</HTML>


How to: Visual Basic Scripting - http://msdn.microsoft.com/en-us/library/t0aew7h6%28v=VS.85%29.aspx
APEX-AT-WORK no image

More interesting blog posts about common APEX issues

Von Tobias Arnhold → 4.20.2010
APEX-AT-WORK no image

Get current url string

Von Tobias Arnhold → 4.19.2010

Fill select results with blank rows

Von Tobias Arnhold → 4.14.2010
To fill selects to a specific amount of rows with blank rows. Just use the rownum connect by trick:

-- select template
SELECT *
FROM (SELECT rownum, test_col
FROM test_table t
UNION ALL
SELECT *
FROM (SELECT rownum AS er, 'empty'
FROM dual CONNECT BY rownum <= 99) e
WHERE e.er > (SELECT MAX(rownum) FROM test_table));

-- emp table example for 20 rows
SELECT *
FROM (SELECT rownum, ename, job
FROM emp em
UNION ALL
SELECT *
FROM (SELECT rownum AS er, '-' as er1, '-' as er2
FROM dual CONNECT BY rownum <= 20) e
WHERE e.er > (SELECT MAX(rownum) FROM emp));

I tried the select inside the APEX SQL Workshop:

APEX-AT-WORK no image

Open Windows directory with APEX (IE only)

Von Tobias Arnhold → 4.12.2010
All you need to open a MS file system folder with APEX is this little javascript:
Header part

<script type="text/javascript">
function fnc_window() {w = open('C:\\Users', "winLov","scrollbars=yes,resizable=no,width=600,height=400");
if (w.opener == null)
w.opener = self;
}
</script>

Open window on page load

<body onload="javascript:fnc_window()">

About a comment from Carsten
Dies ist das richtige Select:
SELECT '\\apc' || pcnummer || '\c$' as LINK FROM table....;
Interessante Idee!
APEX-AT-WORK no image

Open your browser window in fullscreen mode

Von Tobias Arnhold → 4.07.2010
I answered a question in the APEX forum about an automatic full screen mode for your APEX application.

There are a couple of ways how you can achieve this. Anyway there is no simple solution and each way has some bad sides too.

Solution 1: Use a temporary HTML page to open your application window

<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<script type="text/javascript">
window.opener=self;
// fullscreen only
window.open('http://YOUR_URL','','fullscreen=yes');
// fullscreen with no bars inside your browser
window.open('http://YOUR_URL','','fullscreen=yes,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes');
window.close();
</script>
</BODY>
</HTML>

Solution 2: Use ActiveX (IE only)

<HTML>
<HEAD>
<script type="text/javascript">
function fnc_fullscreen()
{
var obj = new ActiveXObject("Wscript.shell");
obj.SendKeys("{f11}");
}
</script>
</HEAD>
<BODY onload="javascript:fnc_fullscreen()">

</BODY>
</HTML>

Solution 3: Set size after max screen size (not good for two screens, not tested yet)

<HTML>
<HEAD>
<script type="text/javascript">
function fnc_fullscreen()
{
window.moveTo(0,0);
window.resizeTo(screen.availWidth,screen.availHeight);
}
</script>
</HEAD>
<BODY onload="javascript:fnc_fullscreen()">

</BODY>
</HTML>

Source: http://www.webmasterworld.com/webmaster/3792262.htm

If you found a better way fixing this issue. I would really like to hear it.