How to compile a single form from command-line Oracle Forms 11g

Create a batch file and enter the following:

[bash]@echo off
echo.
echo. [ Forms Compiler ]
echo.
:: set varables
set FRMCMP=c:\Oracle\Middleware\as_1\bin\frmcmp.exe
set FORMS_DIR=c:\Users\Administrator\java\projects\DOMAIN_NAME\FormsReportsSystem\Forms
set USER_PATH=c:\Users\Administrator
set DEST=c:\FORM_EXECUTABLES
:: get input from console
set /p choice=  Type the form name (w/o extension):
set FORM_NAME=%choice%.fmb
echo.
cd %FORMS_DIR%\tmp
echo. Compiling…
:: command line execution
frmcmp.exe module=%FORMS_DIR%\tmp\%FORM_NAME% userid=user/pass@dbname module_type=form batch=yes compile_all=yes window_state=minimize
set FORM_FMX=%choice%.fmx
echo.        %choice%.fmx created.
echo.
echo. Copy to server…
copy /y %choice%.fmx %DEST%
echo. Done.
echo.
echo. Press any key to re-run…
pause > nul
cls
cd c:\Users\Administrator[/bash]

 

Webutil syntax for GET_FILE_NAME/CLIENT_GET_FILE_NAME function

[sql]FUNCTION GET_FILE_NAME (or CLIENT_GET_FILE_NAME)
(directory_name   VARCHAR2,
file_name        VARCHAR2,
file_filter      VARCHAR2,
message          VARCHAR2,
dialog_type      NUMBER,
select_file      BOOLEAN;[/sql]

Params descriptions

[text]directory_name = Specifies the name of the directory containing the file you want to open. The default value is NULL. If directory_name is NULL, subsequent invocations of the dialog may open the last directory visited.

file_name = Specifies the name of the file you want to open. The default value is NULL.

file_filter = Specifies that only particular files be shown. The default value is NULL. File filters take on different forms, and currently are ignored on the motif and character mode platforms. On Windows, they take the form of “Write Files (*.WRI)|*.WRI|” defaulting to “All Files (*.)|.*|” if NULL. On the Macintosh the attribute currently accepts a string such as “Text.”

message = Specifies the type of file that is being selected. The default value is NULL.

dialog_type = Specifies the intended dialog to OPEN_FILE or SAVE_FILE. The default value is OPEN_FILE.

select_file = Specifies whether the user is selecting files or directories. The default value is TRUE. If dialog_type is set to SAVE_FILE, select_file is internally set to TRUE.[/text]

 

How to use Webutil in Oracle Forms 11g to save a file on Oracle AS 11g

Before you go into any development download and try the Webutil Demo first and see how that works in your environment!

1. Add the Webutil library to the form

2. Create a Data Block “COMMAND_LINE”

3. Create a new layout with the following parameters:

[text]cmd = command-line parameters (data block only)
filename = filename to be entered
browse = browse for file destination
ok_btn = ok button
cancel_btn = cancel button[/text] (more…)

How to close the internet browser window after forms 11g is called

You will need to modify your main entry form procedure and place some javascript code to close the browser window.

1. Create a new html file i.e. “closeWindow.html”, under %ORACLE_HOME%\forms\java\ as below:

[html]<html>
<body onload=”closeWindow()”>
<script type=”text/javascript”>
function closeWindow() {
window.open(”,’_parent’,”);
window.close();
}
</script>
</body>
</html>[/html]

2. Modify the entry form’s POST-FORM Trigger

[sql]–Call the html file created
web.show_document(‘/forms/java/closeWindow.html’,’_self’);
EXIT_FORM(NO_VALIDATE)[/sql]

4. Add the following lines to your “formsweb.cfg” file under [your_cofiguration]
path = c:\Oracle\Middleware\user_projects\domains\<domain_name>\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.1\config\formsweb.cfg

[text]<SCRIPT LANGUAGE=”JavaScript”>window.opener = top;</SCRIPT>
<HTMLbeforeForm=<SCRIPT LANGUAGE=”JavaScript”>window.opener = top;</SCRIPT>[/text]

 

To open see post 1071