表名:dyn_report | |||
Dwobject | Varchar2(20) | 数据窗口对象名称 | Primary key |
Rptitle | Varchar2(80) | 报表的标题名称 | |
Memo | Long raw | 报表格式 |
控件名称 | 控件含义 |
Dw_print | 数据窗口对象 |
Cb_exit | 退出按钮 |
Cb_savereport | 报表格式保存按钮 |
blob emp_pic long ll_handle string ls_dwobject,ls_reportfile,ls_path ls_dwobject = dw_print.dataobject //判断是否存在该数据窗口的报表格式 select count(*) into:ll_count from dyn_report where dwobject =:ls_dwobject; if ll_count>0 then //读取报表格式文件到大文本变量 selectblob memo into:emp_pic from dyn_report where dwobject =:ls_dwobject; //创建psr临时文件到硬盘 ls_reportfile = '\temp7089.psr' ll_handle = FileOpen(is_reportfile,StreamMode!,write!,LockWrite!,Replace!) FileWrite(ll_handle,emp_pic) FileClose(ll_handle) dw_print.dataobject = ls_reportfile dw_print.settransobject(sqlca) else Dw_print.settransobject(sqlca) End if Dw_print.retrieve() 4、报表格式的保存。通过Cb_savereport按钮的clicked实现。 string ls_filename long ll_count blob Emp_id_pic ls_filename = "temp70201.psr" //保存报表格式到硬盘临时文件 dw_print.saveas(ls_filename,PSReport! ,false) sqlca.autocommit = true select count(*) into :ll_count from dyn_report where dwobject =:is_dwobject; if ll_count =0 then insert into dyn_report(dwobject,rptitle) values(:is_dwobject,:ls_filename,:ls_path); end if //从硬盘临时文件读取数据保存到数据库表中 emp_id_pic = of_readbmpfile(ls_filename)//该函数将二进制文件内容读到大文本对象中 //更新数据库 UPDATEBLOB dyn_report SET memo = :Emp_id_pic where dwobject = :is_dwobject; sqlca.autocommit = false |
string ls_type,ls_dwoname //得到对象类型和名称 ls_type = trim(upper(dwo.type)) ls_dwoname = trim(dwo.name) is_dwtype = ls_type choose case ls_type case "TEXT","CommandButton","GROUPBOX" is_dwobject = ls_dwoname //设置为可以拖动和改变大小,其它类同 this.modify(ls_dwoname+".Resizeable='"+"1'") this.modify(ls_dwoname+".moveable="+"1") case "LINE" //直线对象不能通过设置Resizeable和moveable属性进行调整,必须通过其它路径 is_dwobject = ls_dwoname case "RECTANGLE","ELLIPSE","GRAPH","BITMAP" is_dwobject = ls_dwoname this.modify(ls_dwoname+".Resizeable='"+"1'") this.modify(ls_dwoname+".moveable='"+"1'") case "COLUMN","COMPUTE" is_dwobject = ls_dwoname this.modify(ls_dwoname+".Resizeable='"+"1'") this.modify(ls_dwoname+".moveable='"+"1'") end choose |