gpt4 book ai didi

配置 WEBUTIL 后 Oracle Form 卡住

转载 作者:行者123 更新时间:2023-12-05 07:28:19 26 4
gpt4 key购买 nike

我正在使用 Oracle Forms 10g。它是基于 Web 的 Oracle 表单应用程序。我想从 Oracle Forms 10g 生成 Excel 报告。我配置了 WEBUTIL 并使用了 CLIENT_OLE2 包。在触发器 WHEN-BUTTON-PRESSED 中声明的过程。当按下按钮时,表格突然卡住,他们无能为力。退出按钮和菜单选项停止工作。它不提供任何消息,也不执行任何操作。

过程代码:

declare
application client_ole2.obj_type;
workbooks client_ole2.obj_type;
workbook client_ole2.obj_type;
worksheets client_ole2.obj_type;
worksheet client_ole2.obj_type;
cell client_ole2.obj_type;
arglist client_ole2.list_type;
row_num number;
col_num number;
fontObj client_ole2.obj_type;

cursor rec is SELECT so.descr saleorgdescr,ih.invdate invdatemaster, ih.docNUM docnum,
TO_CHAR(ih.invdate,'mon-yyyy') invmonth
FROM ARMINVHEAD ih, SDMSALEORG so
WHERE
ih.status='69'
AND TO_DATE(ih.INVDATE,'DD-MM-RRRR')
BETWEEN
TO_DATE('01-01-2008','DD-MM-RRRR')
AND
TO_DATE('01-01-2009','DD-MM-RRRR')
order by IH.INVDATE, ih.docnum;

procedure SetCellValue(rowid number,colid number,cellValue varchar) is
begin
arglist := client_ole2.create_arglist;
client_ole2.add_arg(arglist,rowid);
client_ole2.add_arg(arglist,colid);
cell:= client_ole2.get_obj_property(worksheet,'Cells',arglist);
fontObj := client_ole2.get_obj_property(cell,'Font');
client_ole2.destroy_arglist(arglist);
client_ole2.set_property(cell,'value',cellValue);
client_ole2.set_property(fontObj,'Size',16);
client_ole2.set_property(fontObj,'BOLD',1);
client_ole2.set_property(fontObj,'ColorIndex',7);
client_ole2.release_obj(cell);
end SetCellValue;

procedure app_init is
begin
application := client_ole2.create_obj('Excel.Application');
client_ole2.set_property(application,'Visible',true);
workbooks := client_ole2.get_obj_property(application,'workbooks');
workbook := client_ole2.Get_Obj_Property(workbooks,'add');
worksheets := client_ole2.get_obj_property(application,'worksheets');
worksheet := client_ole2.Get_Obj_Property(worksheets,'add');
client_ole2.set_property(worksheet,'Name','Emp Sheet');
end app_init;

procedure save_excel(path varchar,filename varchar) is
begin
client_OLE2.Release_Obj(worksheet);
client_OLE2.Release_Obj(worksheets);
-- Save the Excel file created
If path is not null then
Arglist := client_OLE2.Create_Arglist;
client_OLE2.Add_Arg(Arglist,path||'\'||file_name||'.xls');
client_OLE2.Invoke(workbook, 'SaveAs', Arglist);
client_OLE2.Destroy_Arglist(Arglist);
end if;
end save_excel;

begin
app_init;
row_num:=1;
col_num:=1;
SetCellValue(row_num,col_num,'saleorgdescr');
col_num:=col_num + 1;
SetCellValue(row_num,col_num,'invdatemaster');
col_num:=col_num + 1;
SetCellValue(row_num,col_num,'docnum');
col_num:=col_num + 1;
SetCellValue(row_num,col_num,'invmonth');
for i in rec loop
row_num:=row_num + 1;
col_num:=1;
SetCellValue(row_num,col_num,i.saleorgdescr);
col_num:=2;
SetCellValue(row_num,col_num,i.invdatemaster);
col_num:=3;
SetCellValue(row_num,col_num,i.docnum);
col_num:=4;
SetCellValue(row_num,col_num,i.invmonth);
end loop;
save_excel('C:','emp_data');
client_OLE2.Release_Obj(workbook);
client_OLE2.Release_Obj(workbooks);
client_OLE2.Release_Obj(application);
end;

最佳答案

很可能您丢失了以下两组之一中列出的文件:

  • frmwebutil.jar, jacob.jar( perhaps frmall_jinit.jar also ) files in the \forms\java directory

or

  • jacob-1.14.3-x86.dll, JNIsharedstubs.dll and d2kwut60.dll files in the C:\Program Files (x86)\Java\jre1.8.0_xxx\bin directory

假设您的 Oracle Fusion Middleware HomeC:\ORACLE_10g。如果该目录中不存在它们,手动将它们移动到那里就足够了。

  • Moreover, they are preferred to be included in the CLASSPATH as CLASSPATH=C:\ORACLE_10g\forms\java\jacob.jar;C:\ORACLE_10g\forms\java\frmwebutil.jar;

and

  • Edit file C:\Program Files (x86)\Java\jre1.8.0_xxx\lib\security\java.policy as adding
    permission java.security.AllPermission; to the bottom of the file
    just before the last curly brace with a semi-colon };

就在 Forms 应用程序运行之前,Oracle 会提示您签署这些文件。他们需要通过选中 always 选项进行签名。

关于配置 WEBUTIL 后 Oracle Form 卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53445941/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com