1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
| PROCEDURE trans IS
MyApplication CLIENT_OLE2.OBJ_TYPE;
args CLIENT_OLE2.LIST_TYPE;
wbs CLIENT_OLE2.OBJ_TYPE;
wb CLIENT_OLE2.OBJ_TYPE;
wss CLIENT_OLE2.OBJ_TYPE;
cell CLIENT_OLE2.OBJ_TYPE;
cursor c_cur is select DATE_INT,INTERVIEWER,COMMENTAIRE
from entretiens
where DATE_INT=:global.var ;
oo c_cur%ROWTYPE;
c1 number(4);
c2 number(4);
args1 OLE2.LIST_TYPE;
BEGIN
MyApplication := CLIENT_OLE2.CREATE_OBJ('Excel.Application');
CLIENT_OLE2.SET_PROPERTY(MyApplication , 'Visible',1);
wbs := CLIENT_OLE2.GET_OBJ_PROPERTY(MyApplication ,'Workbooks');
wb := CLIENT_OLE2.INVOKE_OBJ(wbs,'Add');
wss := CLIENT_OLE2.GET_OBJ_PROPERTY(MyApplication ,'ActiveSheet');
CLIENT_OLE2.SET_PROPERTY(wss , 'Value','Sheet1');
OPEN c_cur;
c1:=2;
LOOP
c2:=1;
fetch c_cur into oo;
exit when c_cur%NOTFOUND;
loop
if c2=3 then exit;
end if;
args := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(args, c1);
CLIENT_OLE2.ADD_ARG(args, c2);
cell := CLIENT_OLE2.GET_OBJ_PROPERTY(wss,'Cells', args);
CLIENT_OLE2.SET_PROPERTY(cell, 'Value', oo.DATE_INT);
CLIENT_OLE2.DESTROY_ARGLIST(args);
CLIENT_ole2.release_obj(cell);
args := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(args, 1);
CLIENT_OLE2.ADD_ARG(args, 1);
cell := CLIENT_OLE2.GET_OBJ_PROPERTY(wss,'Cells',args);
CLIENT_OLE2.SET_PROPERTY(cell, 'Value','code candidat' );
CLIENT_OLE2.DESTROY_ARGLIST(args);
CLIENT_ole2.release_obj(cell);
c2:=c2+1;
args := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(args, c1);
CLIENT_OLE2.ADD_ARG(args, c2);
cell := CLIENT_OLE2.GET_OBJ_PROPERTY(wss,'Cells', args);
CLIENT_OLE2.SET_PROPERTY(cell, 'Value',oo.INTERVIEWER);
CLIENT_OLE2.DESTROY_ARGLIST(args);
CLIENT_ole2.release_obj(cell);
args := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(args, 1);
CLIENT_OLE2.ADD_ARG(args, 2);
cell := CLIENT_OLE2.GET_OBJ_PROPERTY(wss,'Cells',args);
CLIENT_OLE2.SET_PROPERTY(cell, 'Value','nom candidat' );
CLIENT_OLE2.DESTROY_ARGLIST(args);
CLIENT_ole2.release_obj(cell);
c2:=c2+1;
args := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(args, c1);
CLIENT_OLE2.ADD_ARG(args, c2);
cell := CLIENT_OLE2.GET_OBJ_PROPERTY(wss,'Cells', args);
CLIENT_OLE2.SET_PROPERTY(cell, 'Value',oo.COMMENTAIRE);
CLIENT_OLE2.DESTROY_ARGLIST(args);
CLIENT_ole2.release_obj(cell);
args := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(args, 1);
CLIENT_OLE2.ADD_ARG(args, 3);
cell := CLIENT_OLE2.GET_OBJ_PROPERTY(wss,'Cells',args);
CLIENT_OLE2.SET_PROPERTY(cell, 'Value','prenom candidat' );
CLIENT_OLE2.DESTROY_ARGLIST(args);
CLIENT_ole2.release_obj(cell);
END LOOP;
c1:=c1+1;
END LOOP;
CLOSE c_cur;
CLIENT_OLE2.DESTROY_ARGLIST(args);
args1 := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(args1,:global.filename);
CLIENT_OLE2.INVOKE(wb, 'SaveAs', args1);
CLIENT_OLE2.DESTROY_ARGLIST(args1);
--CLIENT_OLE2.INVOKE(wb,'CLOSE');
--CLIENT_ole2.invoke(MYApplication,'Quit');
CLIENT_ole2.release_obj(wb);
CLIENT_ole2.release_obj(wbs);
CLIENT_ole2.release_obj(wss);
CLIENT_ole2.release_obj(wss);
CLIENT_ole2.release_obj(wb);
CLIENT_OLE2.RELEASE_OBJ(MyApplication);
END; |
Partager