$PBExportHeader$w_rpt_imexport_field.srw forward global type w_rpt_imexport_field from w_publ_base end type type sle_filename from singlelineedit within w_rpt_imexport_field end type type cb_1 from uo_imflatbutton within w_rpt_imexport_field end type type cb_import from uo_imflatbutton within w_rpt_imexport_field end type type cb_export from uo_imflatbutton within w_rpt_imexport_field end type type sle_filename1 from singlelineedit within w_rpt_imexport_field end type type cb_2 from uo_imflatbutton within w_rpt_imexport_field end type type gb_1 from groupbox within w_rpt_imexport_field end type type gb_2 from groupbox within w_rpt_imexport_field end type end forward global type w_rpt_imexport_field from w_publ_base integer width = 2235 integer height = 760 string title = "龙嘉导入导出单据列表" boolean minbox = false windowtype windowtype = response! long backcolor = 67108864 sle_filename sle_filename cb_1 cb_1 cb_import cb_import cb_export cb_export sle_filename1 sle_filename1 cb_2 cb_2 gb_1 gb_1 gb_2 gb_2 end type global w_rpt_imexport_field w_rpt_imexport_field type variables end variables on w_rpt_imexport_field.create int iCurrent call super::create this.sle_filename=create sle_filename this.cb_1=create cb_1 this.cb_import=create cb_import this.cb_export=create cb_export this.sle_filename1=create sle_filename1 this.cb_2=create cb_2 this.gb_1=create gb_1 this.gb_2=create gb_2 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.sle_filename this.Control[iCurrent+2]=this.cb_1 this.Control[iCurrent+3]=this.cb_import this.Control[iCurrent+4]=this.cb_export this.Control[iCurrent+5]=this.sle_filename1 this.Control[iCurrent+6]=this.cb_2 this.Control[iCurrent+7]=this.gb_1 this.Control[iCurrent+8]=this.gb_2 end on on w_rpt_imexport_field.destroy call super::destroy destroy(this.sle_filename) destroy(this.cb_1) destroy(this.cb_import) destroy(this.cb_export) destroy(this.sle_filename1) destroy(this.cb_2) destroy(this.gb_1) destroy(this.gb_2) end on type cb_func from w_publ_base`cb_func within w_rpt_imexport_field boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_rpt_imexport_field integer x = 1824 integer y = 552 integer width = 325 end type type sle_filename from singlelineedit within w_rpt_imexport_field integer x = 91 integer y = 116 integer width = 1586 integer height = 92 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type type cb_1 from uo_imflatbutton within w_rpt_imexport_field integer x = 1701 integer y = 116 integer width = 114 integer height = 96 integer taborder = 40 boolean bringtotop = true string text = "..." end type event clicked;call super::clicked; integer i string pathname string filename i = getfilesavename("选择文件",pathname,filename,"Dbf","数据文件Dbf,*.Dbf") if i = 1 and trim(pathname) <> "" and trim(filename) <> "" then parent.sle_filename.text = pathname end if return end event type cb_import from uo_imflatbutton within w_rpt_imexport_field integer x = 1815 integer y = 116 integer width = 325 integer height = 96 integer taborder = 40 boolean bringtotop = true string text = "导入" end type event clicked;call super::clicked;Long ll_i IF NOT sys_power_issuper THEN MessageBox('提示','你没有使用权限!',information!,OK!) RETURN END IF datastore ds_field String arg_filename arg_filename = Trim(sle_filename.Text) IF arg_filename = '' THEN MessageBox('提示','请输入文件名称',information!,OK!) RETURN END IF ds_field = CREATE datastore ds_field.DataObject = 'dw_rpt_field_def' ds_field.SetTransObject(sqlca) ds_field.ImportFile(arg_filename) ds_field.AcceptText() IF ds_field.RowCount() <= 0 THEN MessageBox('提示','你导入的字段列表文件没有数据',information!,OK!) RETURN END IF DELETE FROM pbcatcol; IF sqlca.SQLCode <> 0 THEN MessageBox('错误','删除原字段列表数据失败,'+sqlca.SQLErrText,stopsign!,OK!) RETURN END IF Int pbc_tid ,pbc_cid,pbc_lpos,pbc_hpos String pbc_ownr,pbc_cnam,pbc_labl,pbc_hdr,pbc_tnam Int pbc_jtfy String pbc_mask Int pbc_case Int pbc_hght Int pbc_wdth String pbc_ptrn String pbc_bmap String pbc_init String pbc_cmnt String pbc_edit String pbc_tag FOR ll_i = 1 TO ds_field.RowCount() pbc_tnam = ds_field.Object.pbc_tnam[ll_i] pbc_tid = ds_field.Object.pbc_tid[ll_i] pbc_cid = ds_field.Object.pbc_cid[ll_i] pbc_lpos = ds_field.Object.pbc_lpos[ll_i] pbc_hpos = ds_field.Object.pbc_hpos[ll_i] pbc_ownr = ds_field.Object.pbc_ownr[ll_i] pbc_cnam = ds_field.Object.pbc_cnam[ll_i] pbc_labl = ds_field.Object.pbc_labl[ll_i] pbc_hdr = ds_field.Object.pbc_hdr[ll_i] pbc_jtfy = ds_field.Object.pbc_jtfy[ll_i] pbc_mask = ds_field.Object.pbc_mask[ll_i] pbc_case = ds_field.Object.pbc_case[ll_i] pbc_hght = ds_field.Object.pbc_hght[ll_i] pbc_wdth = ds_field.Object.pbc_wdth[ll_i] pbc_ptrn = ds_field.Object.pbc_ptrn[ll_i] pbc_bmap = ds_field.Object.pbc_bmap[ll_i] pbc_init = ds_field.Object.pbc_init[ll_i] pbc_cmnt = ds_field.Object.pbc_cmnt[ll_i] pbc_edit = ds_field.Object.pbc_edit[ll_i] pbc_tag = ds_field.Object.pbc_tag[ll_i] INSERT INTO pbcatcol( pbc_tnam , pbc_tid , pbc_cid, pbc_lpos, pbc_hpos, pbc_ownr, pbc_cnam, pbc_labl, pbc_hdr , pbc_jtfy , pbc_mask, pbc_case , pbc_hght , pbc_wdth , pbc_ptrn , pbc_bmap, pbc_init, pbc_cmnt, pbc_edit, pbc_tag ) VALUES( :pbc_tnam , :pbc_tid , :pbc_cid, :pbc_lpos, :pbc_hpos, :pbc_ownr, :pbc_cnam, :pbc_labl, :pbc_hdr , :pbc_jtfy , :pbc_mask, :pbc_case , :pbc_hght , :pbc_wdth , :pbc_ptrn , :pbc_bmap, :pbc_init, :pbc_cmnt, :pbc_edit, :pbc_tag); IF sqlca.SQLCode <> 0 THEN MessageBox('错误','导入字段列表数据失败,'+sqlca.SQLErrText,stopsign!,OK!) RETURN END IF NEXT COMMIT; MessageBox('提示','导入字段列表数据成功',information!,OK!) end event type cb_export from uo_imflatbutton within w_rpt_imexport_field integer x = 1815 integer y = 368 integer width = 325 integer height = 96 integer taborder = 40 boolean bringtotop = true string text = "导出" end type event clicked;call super::clicked; string arg_filename,arg_msg blob arg_blob arg_filename = trim(sle_filename1.text) if arg_filename = '' then messagebox('提示','请输入文件名称',information!,OK!) return end if if messagebox("询问","是否确定要将字段列表导出成文件",question!,yesno!,1) = 2 then return end if datastore ds_field ds_field = create datastore ds_field.dataobject = 'dw_rpt_field_def' ds_field.settransobject(sqlca) ds_field.retrieve('-1') if fileexists(arg_filename) then if messagebox("询问","指定文件已经存在,是否覆盖该文件?",question!,yesno!,2) = 2 then return end if end if if ds_field.saveas(arg_filename,dBASE3!,false) = 1 then arg_msg = '数据导出成功!' else arg_msg = '数据导出失败,如果该文件已打开请先关闭此文件再试!' end if messagebox('提示',arg_msg,information!,OK!) end event type sle_filename1 from singlelineedit within w_rpt_imexport_field integer x = 91 integer y = 368 integer width = 1586 integer height = 92 integer taborder = 40 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type type cb_2 from uo_imflatbutton within w_rpt_imexport_field integer x = 1701 integer y = 368 integer width = 114 integer height = 96 integer taborder = 50 boolean bringtotop = true string text = "..." end type event clicked;call super::clicked; integer i string pathname string filename i = getfilesavename("选择文件",pathname,filename,"Dbf","数据文件Dbf,*.Dbf") if i = 1 and trim(pathname) <> "" and trim(filename) <> "" then parent.sle_filename1.text = pathname end if return end event type gb_1 from groupbox within w_rpt_imexport_field integer x = 59 integer y = 48 integer width = 2107 integer height = 216 integer taborder = 10 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 79741120 string text = "导入文件路径" end type type gb_2 from groupbox within w_rpt_imexport_field integer x = 59 integer y = 300 integer width = 2107 integer height = 216 integer taborder = 20 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 79741120 string text = "导出文件路径" end type