$PBExportHeader$w_subject_export.srw forward global type w_subject_export from Window end type type cb_3 from commandbutton within w_subject_export end type type sle_filename from singlelineedit within w_subject_export end type type cb_2 from commandbutton within w_subject_export end type type cb_export from commandbutton within w_subject_export end type type gb_1 from groupbox within w_subject_export end type end forward global type w_subject_export from Window int X=1056 int Y=456 int Width=2213 int Height=624 boolean TitleBar=true string Title="科目录出" long BackColor=81324524 boolean ControlMenu=true boolean MinBox=true WindowType WindowType=popup! cb_3 cb_3 sle_filename sle_filename cb_2 cb_2 cb_export cb_export gb_1 gb_1 end type global w_subject_export w_subject_export type variables BOOLEAN OL_BACKUP=TRUE end variables on w_subject_export.create this.cb_3=create cb_3 this.sle_filename=create sle_filename this.cb_2=create cb_2 this.cb_export=create cb_export this.gb_1=create gb_1 this.Control[]={this.cb_3,& this.sle_filename,& this.cb_2,& this.cb_export,& this.gb_1} end on on w_subject_export.destroy destroy(this.cb_3) destroy(this.sle_filename) destroy(this.cb_2) destroy(this.cb_export) destroy(this.gb_1) end on event open;//wf_movetocenter environment exerun_env GetEnvironment(exerun_env ) this.Move ( (PixelsToUnits(exerun_env.screenwidth, XPixelsToUnits!) - this.Width)/2,& (PixelsToUnits(exerun_env.screenheight, XPixelsToUnits!) - this.Height - 350 )/2) // //this.Move ( (exerun_env.screenwidth*4.62 - this.Width)/2, (exerun_env.screenheight*3.87 - this.Height)/2) return 0 end event type cb_3 from commandbutton within w_subject_export int X=1970 int Y=124 int Width=137 int Height=84 int TabOrder=30 string Text="..." int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event clicked;//new Integer i String Pathname,Filename i = GetFileSaveName("选择导出文件",Pathname,Filename,"Dbf","数据文件Dbf,*.Dbf") IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN cb_export.Enabled = OL_BACKUP sle_filename.Text = Pathname END IF end event type sle_filename from singlelineedit within w_subject_export event key pbm_keydown int X=91 int Y=120 int Width=1870 int Height=92 int TabOrder=20 BorderStyle BorderStyle=StyleLowered! boolean AutoHScroll=false long TextColor=33554432 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event key;IF Trim(THIS.Text) = "" THEN cb_export.Enabled = FALSE ELSE cb_export.Enabled = OL_BACKUP END IF end event event modified;IF Trim(THIS.Text) = "" THEN cb_export.Enabled = FALSE ELSE cb_export.Enabled = OL_BACKUP END IF end event type cb_2 from commandbutton within w_subject_export int X=1166 int Y=344 int Width=311 int Height=96 int TabOrder=40 string Text="退出" int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event clicked;close(parent) end event type cb_export from commandbutton within w_subject_export int X=567 int Y=344 int Width=311 int Height=96 int TabOrder=10 boolean Enabled=false string Text="导出" int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type event clicked;IF NOT sys_power_issuper THEN MessageBox(publ_operator,'你没有使用权限!') RETURN END IF String arg_filename,arg_msg Blob arg_blob arg_filename = Trim(sle_filename.Text) IF arg_filename = '' THEN MessageBox('系统提示','请输入文件名称') RETURN END IF IF MessageBox("系统提示","是否确定要将帐套科目导出成文件",question!,yesno!,1) = 2 THEN RETURN END IF datastore ds_tmp ds_tmp = CREATE datastore ds_tmp.DataObject = 'dw_subject_export' ds_tmp.SetTransObject(sqlca) ds_tmp.Retrieve(sys_accsetid) IF FileExists(arg_filename) THEN IF MessageBox("系统提示","指定文件已经存在,是否覆盖该文件?",question!,yesno!,2) = 2 THEN RETURN END IF END IF IF ds_tmp.SaveAs(arg_filename,dbase2!,FALSE) = 1 THEN arg_msg = '数据导出成功!' ELSE arg_msg = '数据导出失败,如果该文件已打开请先关闭此文件再试!' END IF MessageBox('提示',arg_msg) end event type gb_1 from groupbox within w_subject_export int X=55 int Y=44 int Width=2089 int Height=228 int TabOrder=30 string Text="导出文件路径" BorderStyle BorderStyle=StyleLowered! long TextColor=33554432 long BackColor=67108864 int TextSize=-9 int Weight=400 string FaceName="宋体" FontCharSet FontCharSet=GB2312CharSet! FontPitch FontPitch=Variable! end type