Home » Developer & Programmer » Forms » Progress Bar (Oracle forms 10g)
Progress Bar [message #345645] Thu, 04 September 2008 06:25 Go to next message
dewdrops_ankur
Messages: 25
Registered: August 2008
Junior Member
Hi,

I have excel funtionality in my application which is used to send all the data which is there on the form to the excel sheet.

Somethimes the data is thousands of records so it takes alot of time.

I want to add progress bar kind to stuff in it so the user may now how much is done and how much is left.

Please help me in doing so.

Thanks in Adavnce!!!

Regards,
Ankur
http://planetofsolutions.blogspot.com

[Updated on: Thu, 04 September 2008 06:34]

Report message to a moderator

Re: Progress Bar [message #345648 is a reply to message #345645] Thu, 04 September 2008 06:32 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

Did you search for Progress bar in this forum?
Re: Progress Bar [message #345653 is a reply to message #345648] Thu, 04 September 2008 06:40 Go to previous messageGo to next message
dewdrops_ankur
Messages: 25
Registered: August 2008
Junior Member
I searched and i got one also but i want the excel functionality and progress bar should work in parrallel.

Regards,
Ankur
http://planetofsolutions.blogspot.com
Re: Progress Bar [message #345656 is a reply to message #345653] Thu, 04 September 2008 06:46 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

so tell us what you have and we can guide you
Re: Progress Bar [message #345659 is a reply to message #345656] Thu, 04 September 2008 06:56 Go to previous messageGo to next message
dewdrops_ankur
Messages: 25
Registered: August 2008
Junior Member
Im migrating one application from 6i to 10g.

It is having one functionality to send all the data to excel.

Sometimes there are thousands of records to be send to excel and it takes alot of time so i want one progress bar so that the user can know how much is done and how much is left.

Regards,
http://planetofsolutions.blogspot.com
Re: Progress Bar [message #345663 is a reply to message #345659] Thu, 04 September 2008 07:15 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

I know what you want right from the first post.

Quote:
searched and i got one also but i want the excel functionality and progress bar should work in parrallel.


1. What do you have regarding progress bar?
2. What did you try and did not work?

Re: Progress Bar [message #345670 is a reply to message #345663] Thu, 04 September 2008 07:27 Go to previous messageGo to next message
dewdrops_ankur
Messages: 25
Registered: August 2008
Junior Member
I tried with stacked canvas but it didnt work.

I have number of records which are to be send to excel for the progress bar.

Regards,
Ankur
http://planetofsolutions.blogspot.com

[Updated on: Thu, 04 September 2008 07:27]

Report message to a moderator

Re: Progress Bar [message #345802 is a reply to message #345670] Thu, 04 September 2008 20:00 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

I f you really did search for progress bar then you now have at least a running progress bar and you can test that by the use of simple loop.
Now, if you are exporting data to excel, i'm sure you use cursor/loops. So why can't you do it correctly?

What did you try? Be detailed.
Show us your code. It's better to read many lines of codes than guessing for what you are doing.
Re: Progress Bar [message #347074 is a reply to message #345802] Wed, 10 September 2008 10:20 Go to previous messageGo to next message
dewdrops_ankur
Messages: 25
Registered: August 2008
Junior Member
Sorry i was on leave due to some personal resons.

The following is the code which i'm using for excel data and progress bar.
The code inside comments like start added by ankur
is added by me to implement the progress bar

excel functionality procedure
DECLARE
cursorID EXEC_SQL.CURSTYPE;
nIgn PLS_INTEGER;
line1 varchar2(8000);
hsql varchar2(8000);
regkey varchar2(80);
i number;
hold_block varchar2(31);
hold_record number;
hold_item varchar2(64);
out_file CLIENT_TEXT_IO.FILE_TYPE;
cmd varchar2(120);
flnm varchar2(50);
genno number ;
--Start added by Ankur for Progress Bar
total Number;
temp Number;
--Stop added by Ankur for Progress Bar
BEGIN

:print_setup.print_opt := 'P' ;

hold_block := :System.Cursor_Block;
hold_record := :System.Cursor_Record;
hold_item := :System.Cursor_Item;

if :System.Cursor_block != 'TAPE1' then
i := Show_Alert('No_EXCEL');
Raise Form_Trigger_Failure;
end if;

:print_setup.tot_rec := TO_NUMBER(Get_Block_Property(hold_block,
QUERY_HITS));

--Start added by Ankur for Progress Bar
total:=round(:print_setup.tot_rec/10);
--Message(total);
--message(total);
--Stop added by Ankur for Progress Bar

Go_Item('print_setup.tot_rec');
:print_setup.record := 0;
--Synchronize;

/* Get a number from the sequence generator to get a unique
number for the report generated */
select general_seq.nextval into genno
from dual;

flnm := 'c:\myfiles\hdlbase\hdlbase'||to_char(genno)||'.csv';
out_file := CLIENT_TEXT_IO.FOPEN(flnm,'W');


line1 := 'SHELF NUMBER,TAPE NUMBER,OWNER,TAPE FORMAT,';
hsql := 'SELECT ''"''||SHELF_NUMBER||''","''||TAPE_NUMBER||''","''||OWNER||''","''||NVL(TAPE_FORMAT_DESC,TO_char(T.TAPE_FORMAT))||''","''||';
FOR col_rec in (SELECT column_name
FROM all_tab_columns
WHERE owner = 'HDLBASE'
AND table_name = 'HDLTAPES'
AND column_name not in ('SHELF_NUMBER','TAPE_NUMBER','OWNER','TAPE_FORMAT')) LOOP
line1 := line1 || TRANSLATE(col_rec.column_name,'ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_','ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 ')||',';
hsql := hsql || col_rec.column_name||'||''","''||';
end loop;

if line1 = 'SHELF NUMBER,TAPE NUMBER,OWNER,TAPE FORMAT' then
i := Show_Alert('No_EXCEL');
Raise Form_Trigger_Failure;
end if;
CLIENT_TEXT_IO.PUT_LINE(out_file,substr(line1,1,length(line1) - 1));
hsql := substr(hsql,1,length(hsql) - 9) || '||''"''' ||
' FROM HDLBASE.HDLTAPES T, HDLBASE.HDL_TAPE_FMT TF' ||
' WHERE T.TAPE_FORMAT = TF.TAPE_FORMAT(+)';

Go_Block(hold_block);
<<Next_rec>>
Go_Record(hold_record);
Go_Item(hold_item);
Go_Item('print_setup.tot_rec');
:print_setup.record := :print_setup.record + 1;

--Start added by Ankur for Progress Bar
temp:=:print_setup.record;
if temp/total = 1 then
bar1(1);
end if;
--Stop added by Ankur for Progress Bar


--Synchronize;
Go_Block(hold_block);
Go_Record(:print_setup.record);
cursorID := EXEC_SQL.OPEN_CURSOR;
line1 := hsql||' AND SHELF_NUMBER = '''||:TAPE1.SHELF_NUMBER||'''';
EXEC_SQL.PARSE(cursorID, hsql||' AND SHELF_NUMBER = '''||:TAPE1.SHELF_NUMBER||'''', exec_sql.V7);
EXEC_SQL.DEFINE_COLUMN(cursorID, 1, 'VARCHAR2',8000);
nIgn := EXEC_SQL.EXECUTE(cursorID);
LOOP
IF (EXEC_SQL.FETCH_ROWS(cursorID) > 0) THEN
EXEC_SQL.COLUMN_VALUE(cursorID, 1, line1);
CLIENT_TEXT_IO.PUT_LINE(out_file,line1);
ELSE
EXIT;
END IF;
END LOOP;
EXEC_SQL.CLOSE_CURSOR(cursorID);
if :System.Last_record != 'TRUE' then
goto Next_rec;
end if;
CLIENT_TEXT_IO.FCLOSE(out_file);
regkey := Client_Win_Api_Environment.Read_Registry('HKEY_CLASSES_ROOT\.csv',null,TRUE);
regkey := Client_Win_Api_Environment.Read_Registry('HKEY_CLASSES_ROOT\'||regkey||'\shell\Open\Command',null,TRUE);
-- Message('REGKEY = '||regkey, ACKNOWLEDGE);
cmd := regkey||' '||flnm;
CLIENT_HOST(cmd);
Go_Block(hold_block);
Go_Record(hold_record);
Go_Item(hold_item);
EXEC_SQL.CLOSE_CONNECTION;


END;

Bar1 procedure

PROCEDURE bar1
(num number)
IS
BEGIN
set_item_property('progress_bar.item144',VISUAL_ATTRIBUTE,'PROGRESS_BAR');
END;


the problem is the that it changes the color of the text box after whole of the excel functionality procedure have run.I mean to say when whole the data is in the excel sheet.

Please help!!!

Thanks in Advance!!!

Regards
Ankur
http://planetofsolutions.blogspot.com

[Updated on: Wed, 10 September 2008 10:21]

Report message to a moderator

Re: Progress Bar [message #348012 is a reply to message #347074] Mon, 15 September 2008 06:59 Go to previous messageGo to next message
dewdrops_ankur
Messages: 25
Registered: August 2008
Junior Member
I have developed the solutions.

thanks!!!

Regards,
Ankur
http://planetofsolutions.blogspot.com
Re: Progress Bar [message #348215 is a reply to message #348012] Tue, 16 September 2008 01:11 Go to previous message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

Thats great... why dont you share your solution with us for others to learn.
Previous Topic: FRM-92102
Next Topic: Block Where Clause Problem
Goto Forum:
  


Current Time: Sat Dec 03 16:00:58 CST 2016

Total time taken to generate the page: 0.08609 seconds