Generate Forms and Reports Batch Script

A HunBug Document
Document No.: 11390
Forms Version: 9i R2 (adaptable)
Last Updated: 01 Jul 2007
Author: HunBug

Generating a directory full of forms and reports can be a painfully dull and slow process to do manually. Using a script, such as the one below can make life a lot easier.

Batch Command Script

The script contains three parameters:
OraHome: Points to the Developer Suite home directory
FrmHome: The directory containing the FMB, MMB and PLL files
RepHome: The directory containing the RDF files
In this example, another parameter "Conn" is entered at runtime. This can obviously be modified to a constant parameter if required.

@ECHO OFF

CD /D %~dp0

SET OraHome=C:\Oracle\DS
SET FrmHome=C:\Oracle\Dev\Forms
SET RepHome=C:\Oracle\Dev\Reports

SET /P Conn="Enter Connect String : "


CD /D %FrmHome%
FOR %%F IN (*.pll) DO %OraHome%\BIN\IFCMP90 MODULE=%%~nxF USERID=%Conn% MODULE_TYPE=LIBRARY BATCH=YES COMPILE_ALL=YES WINDOW_STATE=MINIMIZE

FOR %%F IN (*.mmb) DO %OraHome%\BIN\IFCMP90 MODULE=%%~nxF USERID=%Conn% MODULE_TYPE=MENU    BATCH=YES COMPILE_ALL=YES WINDOW_STATE=MINIMIZE

FOR %%F IN (*.fmb) DO %OraHome%\BIN\IFCMP90 MODULE=%%~nxF USERID=%Conn% MODULE_TYPE=FORM    BATCH=YES COMPILE_ALL=YES WINDOW_STATE=MINIMIZE


CD /D %RepHome%
FOR %%F IN (*.rdf) DO %OraHome%\BIN\RWCONVERTER USERID=%Conn% BATCH=YES STYPE=RDFFILE SOURCE=%%~nxF OVERWRITE=YES


CD /D %~dp0
PAUSE

Read-Only Files

The forms, menus and libraries will not generate if the files are set to read-only. This is common if you use version control software. The following example can replace each generate for loop in the above example. The code below renames the file to include a .bak extension. It then copies this file back to the original name. We now have a file to generate which is not read only. After the file is generated, we delete the new file and rename the original file back to its original name. There is then no change to the last change date of the binary file.

FOR %%F IN (*.fmb) DO MOVE %%~nxF %%~nxF.bak & ^
COPY %%~nxF.bak %%~nxF & ^
%OraHome%\BIN\IFCMP90 MODULE=%%~nxF USERID=%Conn% MODULE_TYPE=FORM BATCH=YES COMPILE_ALL=YES WINDOW_STATE=MINIMIZE & ^
DEL %%~nxF & ^
MOVE %%~nxF.bak %%~nxF

As the code contains deletes it may be wise to include a general backup at the begining of the script, just in case.

Further Reading


HunBug Store








Comments are all individually read, none are automatically posted to the site.