Progress bar or status bar in forms 6i

I have one simple form with single button and display item "status".
 suppose  on when button pressed  triggere  iam selecting all the records from emp table and inserting into  other x_emp table having same structure. during this  phenomenon  i mean to say selecting and inserting process i want to show  the user the progress bar  filled with color.(like 10% completed ...20% completed or simply progress bar ) but progress bar should increase  according to transaction means transaction dependent. . Please send me code with description.
Who is Participating?
annamalai77Connect With a Mentor Commented:
hi there

musdu method is a proven method and a good one to. i have implemented one like that in my application.


you can create a progress bar using a display item with colour. To simulate progress, you can increase length of display item. Assume that you have a proc Progress(pRatio) to do that.

Code behind your button to load emp x_emp table;


  vCount INTEGER;
  i INTEGER := 0;


  SELECT Count(*) INTO vCount
     FROM Emp;


        vRec.Col1, vRec.Col2, ....);

    i := i + 1;




Helena Markováprogrammer-analystCommented:
Here is Note:216479.1 from MetLink:

1.  Create  a user defined  parameter PARAM_PERC and datatype Number, Intial value as 0 and maximum value as 30
2.Create  a control block  P_bar below items
  a) P_BAR text item  Datatype char size 200, Bevel  None ,Height 227, Width 11
  b) T_STATUS Display item which displays the % on line
  c) STEP  command button
  d) CLEAR Command button

 Program Unit Clear
     :t_status := '0%';

e) prog_bar_step

 PROCEDURE prog_bar_step  IS
   a  number :=:delay;
   :t_status := round(:PARAMETER.PARAM_PERC)||'%';

f)  In the STEP command button when button pressed trigger call the procedure  prog_bar_step;
  this will increment the status bar by one step. Depending on the requirement you can call this in any program unit so that it will increment.

If you want to display a progress bar that executes automatically then you can create a timer and put the procedure  prog_bar_step in that. But Timers are not recommended for the Web forms.
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

rehman123Author Commented:
can send me code for -----Progress(pRatio) ---
Henka sent :)
In many programs such as installer, you will be able to see a boxindicating what percentage of work
has been done while some process is under way.  For example, while running an installer, a bar appears
that indicates how much installation has been done.  Similarly, you
may want to graphically display in Forms how much work has been done while working on something.  For
example, given that you have queried a set of records, suppose you want to visually indicate how many
of all records have been edited as you edit them one by one.  This bulletin provides a procedure that
you can call in an appropriate
trigger to increase the percent completed indication in such a progress bar.  Note that each time you
call this procedure, you will see the bar increasing in length.  You should be responsible for implementing
a scheme or an algorithm that determines when to call this procedure so that it correctly reflects how
much work has been

1.  Create a non database block.  In it, create 10 non base table display items.  Make each one look
like a little box, all the same size.  Stack the display items in a line.  Next, put 0% and 100% at
the ends of the arrangement.  You can use Format->Alignment option to
make this easier.  Name those items as I1, I2, I3, ... I10.  You will see something like the following
in the layout editor:
(Below, each letter I represents a display item.)

       *    Progress Indicator Bar    *
       *                              *
       *     I I I I I I I I I I      *
       *  0%                     100% *

2.  Create 2 visual attributes, V1 and V2.  Give them different attributes.  Now, assign V1 to the above
display items by default. You may want to make V2 so that items with this visual attribute will display
a red background and foreground.

3.  In a When-New-Form-Instance trigger, use this code:


4.  Create a Forms procedure called INDICATE with the following code:

   PROCEDURE indicate IS
      i  NUMBER;
      IF :global.counter > 10 THEN
         FOR I IN 1..10 LOOP
            SET_ITEM_PROPERTY('i'||to_char(I), VISUAL_ATTRIBUTE, 'V2');
         END LOOP;
      END IF;
         VISUAL_ATTRIBUTE, 'V1');

5.  In an appropriate trigger, execute INDICATE.  Note that each time you call this procedure, one more
display item will change its color, from V1 to V2.  When all items have changed their color, they will
change their color back to V1.  Therefore, code in your trigger when
to call this PROCEDURE so that it correctly indicates the amount of work that has been done.  See the
example below.

Suppose you have retrieved 10 records in the block and will be editing each record.  Now, you want a
visual indication of how much editing has been done in terms of the number of records.  This is really
simplistic, but it will explain the usage concept.  In this case, you can create a Key-Down trigger
that calls INDICATE.  As you edit each record and go down to the next record, you will see the progress
bar changing its color, properly indicating the amount of work finished.
Likewise, if you have a total of x number of queried records, you can keep a running total of the number
of records edited using a global variable then call INDICATE after you know that a certain percentage
of records have been edited.  You can use the same kind of scheme in a
Post-Query trigger to reflect the total number of records that have been displayed out of the total
records to be fetched.  You can obtain the total by using COUNT_QUERY built-in.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.