Acknowledgement Bar [message #347323] |
Thu, 11 September 2008 05:22  |
dewdrops_ankur
Messages: 25 Registered: August 2008
|
Junior Member |
|
|
Hi to all,
Need help!!!
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 acknowledgement 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 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 then it changes the color of the text box
Please help!!!
Thanks in Advance!!!
Regards
Ankur
http://planetofsolutions.blogspot.com
|
|
|
|
|
|
|
|