Progress bar or status bar in forms 6i

Posted on 2004-04-19
Last Modified: 2007-12-19
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.
Question by:rehman123

Expert Comment

Comment Utility

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;




LVL 22

Expert Comment

by:Helena Marková
Comment Utility
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.

Author Comment

Comment Utility
can send me code for -----Progress(pRatio) ---
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Expert Comment

Comment Utility
Henka sent :)
LVL 47

Expert Comment

Comment Utility
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.

Accepted Solution

annamalai77 earned 500 total points
Comment Utility
hi there

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


Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
compre toata in where clue oracle 4 39
sql query 5 51
Oracle -- identify blocking session 24 22
SQL Retrieve Values 4 37
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now