This discussion is archived
8 Replies Latest reply: Mar 27, 2007 1:11 AM by ths RSS

Progress Bar

480825 Newbie
Currently Being Moderated
How can I display a progress bar from a forms 6i form to indicate a processing and update it periodically within the process?
  • 1. Re: Progress Bar
    341668 Newbie
    Currently Being Moderated
    Hi,
    I don't want to start a "please send it to me", so I'll just lay down the steps:
    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.
    Timers are not recommended for the Web forms. You can use a java bean for that.

    Cheers,

    Monica
  • 2. Re: Progress Bar
    225058 Newbie
    Currently Being Moderated
    Hi Monica,
    just to say that I'm happy to hear "I don't want to start a "please send it to me", " !!!
    And also that you can use the progress bar java bean available for 6i and 10g
    Jean-Yves
  • 3. Re: Progress Bar
    FrançoisDegrelle Oracle ACE
    Currently Being Moderated
    Hello,

    Another but very "basic low budget" solution is to use the status bar

    <img src="http://sheikyerbouti.developpez.com/tmp/barr_progress.jpg">

    With the following code in the When-Button-Pressed trigger:
    Declare
         LC$C Varchar2(120) := '' ;
         LN$Num  Pls_Integer := 100000 ;
         LN$Perc Pls_Integer := LN$Num / 100 ;
         LN$n    Pls_integer := 0;
    Begin
      Clear_Message ;
      For i IN 1..LN$Num Loop
           If mod(i,LN$Perc) = 0 Then
             LN$n := LN$n + 1 ;
             LC$C := LC$C || '|' ;
                Message( Ltrim(To_char( LN$n ) ) || '%' || LC$C, no_acknowledge ) ;
                synchronize ;
           End if ;
      End loop ;     
    End ;
    Francois
  • 4. Re: Progress Bar
    225058 Newbie
    Currently Being Moderated
    François,
    I didn't get this cool one...
    But the experience I have is that the status bar is not seen by most of the users...
    for example when we have ora- errors we convert them to french friendly messages but how many times did I have a call saying "I'm blocked" and when I come to see it was only to read the message to go on....
    But this has not to do with progress bar ..
    Jean-Yves
  • 5. Re: Progress Bar
    FrançoisDegrelle Oracle ACE
    Currently Being Moderated
    You're right, but i can say you will see this message because it increase from0% to 100% (so, things are moving on the screen)

    Francois
  • 6. Re: Progress Bar
    225058 Newbie
    Currently Being Moderated
    That's why I said "cool one".
    Before having the progressbar bean I used the set_item_property width to make the thing move...
    And I prefer not to talk about an old oracle example (in 4.5 I suppose) of a spinning wheel with 4 images and a canvas moving around... lol ;-)
    Jean-Yves
  • 7. Re: Progress Bar
    FrançoisDegrelle Oracle ACE
    Currently Being Moderated
    And I prefer not to talk about an old oracle example
    (in 4.5 I suppose) of a spinning wheel with 4 images
    and a canvas moving around... lol ;-)
    That would be nice at this antic time ! ;-)))

    Francois
  • 8. Re: Progress Bar
    ths Newbie
    Currently Being Moderated
    Hi folks,

    I used several times 2 stacked canvases and 2 display items to simulate a progress bar.

    Put one display item on each stacked canvas, let the items be of the same size as the canvases and overlay the canvases exactly. Give them different colors and/or attributes. On of the items should by synchronized with the other. Both the display items show the message you want in centered orientation, i.e. "437/1000 (43,7%)" and the topmost canvas adjusts its viewport width to reflect the progress. You need a package with an procedure which initializes the stacked canvases, the message displayed by the items and open / show the "bar". A second procedure is called from within your loop (whatever you do there) to calculate the progress and adapt the canvases and items. The last procedure should reset and close / hide the "bar".

    The implementation and code is not so difficult, that you need to post "Please mail me!". Try it yourself, the hints are given.