Tuesday, March 31, 2009

ZööMing property of an image



IMAGE_ZOOM Built-in procedure is used for this effect. Just try the following steps..

Step 1: Load an Image.

Step 2: Place 2 buttons, say Zoom_In and Zoom_Out

Step 3:
/* When-Button-Pressed trigger of Zoom_In */
Image_Zoom('Image', zoom_in_factor, 2);
--This procedure enlarges the image 2 times.

Step 4:
/* When-Button-Pressed trigger of Zoom_Out */
Image_Zoom('Image', zoom_out_factor, 2);
--This procedure reduces the image 2 times.

Caution: If you specify high value for Zoom_Factor (eg. 100), it may cause the application to run out of memory.





Timer Implimentation steps in forms with example

/*This is regarding the usage of a timer and also the retrieval of data from a record group which contains static values*\
--In New form instance trigger--
DECLARE
timer_id Timer;
one_minute NUMBER(5) := 1000; --in milliseconds (ie:1 second)
BEGIN
timer_id := CREATE_TIMER('emp_trasset', one_minute, REPEAT); --timer created
END;

/* This is applied on an item to run surrounding the canvas */
--in when timer expired trigger--
declare
v varchar2(25);
x number;
y number;
begin
/*to get the name of the timer expired . Applicable in case of more than one timers are used*/
v:=get_application_property(timer_name);
--to get time updated in every second & display it in a text item
:TIME:=TO_char(SYSDATE,'HH:MI:SS AM');
--to get the x,y positions
x:=get_item_property('TEST_TEXT',x_pos);
y:=get_item_property('TEST_TEXT',y_pos);
--To retrieve the nth row from the given column
:TEST_TEXT := Get_Group_CHAR_Cell( 'record_group.column_name','nth row to be retrieved');
--Check and set the position within the limit eg:10 to 300 here
if x=10 and y<300 then
x:=10;
y:=y+10;
elsif y=300 and x<300 then
x:=x+10;
y:=300;
elsif x=300 and y<=300 and y>10 then
x:=300;
y:=y-10;
elsif y=10 and x<=300 then
x:=x-10;
y:=10;
else
x:=10;
y:=10;
--set the position of item so that a moving effect is obtained.
end if;
set_item_property('TEST_TEXT',x_pos,x);
set_item_property('TEST_TEXT',y_pos,y);
end;

Passing Parameters from one form to another in Oracle Forms

FORM parameters are of three TYPE char,number, or date .

Follow this steps to pass the parameters.

1.Create a parameter list in the in the calling form


Example


DECLARE
pl_id paramlist;
city_name VARCHAR2 (30) := 'calicut';
city_date DATE := SYSDATE;
BEGIN
pl_id := GET_PARAMETER_LIST ('tempdata');

IF NOT ID_NULL (pl_id)
THEN
DESTROY_PARAMETER_LIST (pl_id);
END IF;

pl_id := CREATE_PARAMETER_LIST ('tempdata');
ADD_PARAMETER (pl_id, 'p_city', text_parameter, city);
ADD_PARAMETER (pl_id, 'p_city_date', text_parameter, TO_CHAR (city_date));
/* Please note that here you can pass only Text i.e., CHAR parameters, that
means if it is other than CHAR you have to convert into CHAR function */
--call the form with parameter
CALL_FORM ('XYZ_FORM', hide, no_replace, no_query_only, pl_id);
END;


2.Create two parameter in the called form with the same name u given for the parameters
in the parameter list .For to do it

  1. In XYZ_FORM, Click on PARAMETERS.
    2. Go to the property sheet of PARAMETER1
    Change the following things
    i) Name = P_CITY /* It must be the same name that what you are passing */
    ii) Data Type = CHAR
    iii) Maximum Length = 30 //sample
    iv) Close the parameter sheet.

    3. Similarly Create one more parameter for P_City_date by clicking "new".
    i) Name = P_CITY_DATE /* It must be the same name that what you are passing */
    ii) Data Type = DATE
    iii) Close the parameter sheet.

So the parameters are

1. P_City
2. P_city_date

3.Access the values of the above parameter in the called form


To access the values of the above parameters in the XYZ_FORM
append with :PARAMETER.
That is
You can access P_City in Xyz_form by :PARAMETER.P_CITY
Similarly for P_City_Date is :PARAMETER.P_CITY_DATE.

Friday, March 27, 2009

Tip for beginners

If you want to make property of a check box disabled and enabled according to situations then pls try this:
first disable the check box by using
set_item_property('BLOCK.ITEM',enabled,property_false);
then when u want to enable that use as shown below
set_item_property('BLOCK.ITEM',enabled,property_true);
set_item_property('BLOCK.ITEM',update_allowed,property_true);

otherwise it will not allow you to update the checkbox status.


Bency J Mathew
s/w engineer
TRASSET INDIA

Thursday, March 26, 2009

Introduction to Oracle Forms

Oracle Forms is a tool (somewhat like Visual Basic in appearance, but the code inside is PL/SQL) which allows a developer to quickly create user-interfaceOracle database in a very efficient and tightly-coupled way. It was originally developed to run server-side in character mode on any UnixMS Windows existed. It was then ported to Windows to function in a client-server environment. Recent versions have been ported to Java. It now runs in a J2EE container and can integrate with Java and web services. applications which access an box, before

The primary focus of Forms is to create data entry systems that access data in an Oracle database.

Oracle Forms accesses the Oracle database and generates a default form that presents the data. The source form (*.fmb) is compiled into an "executable" (*.fmx), that is run (interpreted) by the forms runtime module. The form is used to view and edit data in business applications. Various GUI elements, such as buttons, menus, scrollbars, and graphics can be placed on the form.

The environment supplies built-in record creation, query, and update modes, each with its own default data manipulations. This minimizes the need to program common and tedious operations, such as creating dynamic SQL, sensing changed fields, and locking rows.

As is normal with event driven interfaces, the software implements a complex algorithm, consisting of special functions called triggers, which occur at critical steps in the processing of records, the receipt of keyboard strokes, and the receipt of mouse movements. Different triggers are called before, during, and after each critical step.

Each function is initially a stub, containing a default action or nothing. Programming Oracle Forms therefore generally consists of modifying the contents of these triggers in order to alter the default behavior. Some triggers, if provided by the programmer, replace the default action, others augment it.

As a result of this strategy, it is possible to create a number of default form layouts which possess complete database functionality yet contain no programmer-written code at all.