Progress bar in forms [message #85422] |
Thu, 24 June 2004 02:06 |
Puneet Bhatia
Messages: 7 Registered: February 2004
|
Junior Member |
|
|
Dear friends ,
is it possible to create a progress bar in the forms 4.5( or by any other utilities in developer 2000 suite) . I am not able to see any option.
pls advise.
regds
Puneet
|
|
|
Re: Progress bar in forms [message #85425 is a reply to message #85422] |
Thu, 24 June 2004 08:06 |
Tak Tang
Messages: 142 Registered: May 2004
|
Senior Member |
|
|
I have never tried myself, but I would create something and dynamically change its width to simulate something filling up.
Alternatively, if you are running forms 4.5/5/6, you could use an ActiveX Object. If you are running 9i (or 6i over the web), you could investigate using a Java Bean.
|
|
|
Re: Progress bar in forms [message #85430 is a reply to message #85425] |
Thu, 24 June 2004 23:03 |
Puneet Bhatia
Messages: 7 Registered: February 2004
|
Junior Member |
|
|
Thanx for your reply.
I am using forms 4.5
could you please tell me how can I create something and dynamically change its width to simulate a progress bar as I am not very familier in using aciveX controls.
thanx
PB
|
|
|
Re: Progress bar in forms [message #85432 is a reply to message #85430] |
Fri, 25 June 2004 05:00 |
Tak Tang
Messages: 142 Registered: May 2004
|
Senior Member |
|
|
Add an image item to a block. Make it say 16 pixels high, and 1 pixel wide.
Add a button with a trigger that uses set_item_property to set the WIDTH of the image item to 1, and creates a repeating timer that executes every 50 milli seconds.
Create a when-timer-expired trigger at form level, that fetches the width of the image item with GET_ITEM_PROPERTY. If the width > 100 then delete the timer; else use set_item_property to increase the width by 1.
Then its just a case of making it look pretty.
|
|
|
|
Re: Progress bar in forms [message #85441 is a reply to message #85422] |
Sat, 26 June 2004 13:56 |
Susane
Messages: 27 Registered: September 2002
|
Junior Member |
|
|
hello,
previously that is my problem how to create progress bar in forms... please try this and it will help you...
steps
1 create cursor to compute how many records you have been processed.
CURSOR curctr IS
SELECT COUNT(count (*))
FROM table etc....k_plist
WHERE .....;
2. create variable for progress bar
c NUMBER := 0; -- Counter of total records to be processed
y NUMBER := 0; -- Counter of Percent Process
x NUMBER := 0; -- Counter of Records read
w NUMBER := 0; -- WIDTH of Progress Bar
3. do procedure in your loop statement
OPEN cur_....;
LOOP
FETCH cur_.... INTO rec_....;
EXIT WHEN cur_....%NOTFOUND;
x := x + 1;
y := (x/c) * 100;
:cg$ctrl.item_ctr := x || '/' || c;
IF y < 100 THEN
w := ROUND(( 3.25 / 100 ) * trunc (y), 2);
SET_ITEM_PROPERTY('CG$CTRL.PROGRESS_BAR',WIDTH, w );
SYNCHRONIZE;
END IF;
IF trunc(y) = 100 THEN
:cg$ctrl.progress_bar := 'Completed';
END IF;
:cg$ctrl.percent := trunc(y) || '%';
SYNCHRONIZE;
4. of course you need to create a display item in canvas to show the progress bar....
and it will create or display progress bar in your forms.
i hope it will help you....
any queries pls let me know...
susane
|
|
|