Solved

Progress bar or status bar in forms 6i

Posted on 2004-04-19
6
3,083 Views
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.
0
Comment
Question by:rehman123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 6

Expert Comment

by:musdu
ID: 10857378
Hi,

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;

DECLARE

  vCount INTEGER;
  i INTEGER := 0;

BEGIN

  SELECT Count(*) INTO vCount
     FROM Emp;

  FOR vRec IN (SELECT * FROM Emp) LOOP

    INSERT INTO x_emp VALUES (
        vRec.Col1, vRec.Col2, ....);

    i := i + 1;

    Progress(ROUND(i/vCount));

  END LOOP;

  COMMIT;

END;
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 10857418
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
  PROCEDURE clear IS
   Begin
     :P_bar.P_bar:='';
     :t_status := '0%';
     :PARAMETER.PARAM_PERC :=0;
  END;

e) prog_bar_step

 PROCEDURE prog_bar_step  IS
   a  number :=:delay;
 begin
  IF :PARAMETER.PARAM_PERC >=0 AND :PARAMETER.PARAM_PERC <=100 THEN
   :p_bar.P_bar:=:p_bar.P_bar||'|';
   :PARAMETER.PARAM_PERC := :PARAMETER.PARAM_PERC +1;
   :t_status := round(:PARAMETER.PARAM_PERC)||'%';
  END IF;
end;

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.

ADDITIONAL INFO
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.
0
 

Author Comment

by:rehman123
ID: 10857436
can send me code for -----Progress(pRatio) ---
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 6

Expert Comment

by:musdu
ID: 10857494
Henka sent :)
0
 
LVL 48

Expert Comment

by:schwertner
ID: 10857652
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
done.

Implementation
==============
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:

   :global.counter:=1;

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

   PROCEDURE indicate IS
      i  NUMBER;
   BEGIN
      :global.counter:=TO_CHAR(TO_NUMBER(:global.counter)+1);
      IF :global.counter > 10 THEN
         :global.counter:=1;
         FOR I IN 1..10 LOOP
            SET_ITEM_PROPERTY('i'||to_char(I), VISUAL_ATTRIBUTE, 'V2');
         END LOOP;
         RAISE FORM_TRIGGER_FAILURE;
      END IF;
      SET_ITEM_PROPERTY('i'||TO_CHAR(TO_NUMBER(:global.counter)-1),
         VISUAL_ATTRIBUTE, 'V1');
   END;

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.

Example
=======
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.
1
 
LVL 8

Accepted Solution

by:
annamalai77 earned 500 total points
ID: 10857658
hi there

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

regards
annamalai.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

737 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