$PBExportHeader$w_rp_tj.srw $PBExportComments$报表窗口 forward global type w_rp_tj from w_publ_base end type type cb_2 from uo_imflatbutton within w_rp_tj end type type cb_psetup from uo_imflatbutton within w_rp_tj end type type cb_1 from uo_imflatbutton within w_rp_tj end type type st_3 from statictext within w_rp_tj end type type st_4 from statictext within w_rp_tj end type type em_1 from editmask within w_rp_tj end type type em_2 from editmask within w_rp_tj end type type ddlb_yl from dropdownlistbox within w_rp_tj end type type cbx_yl from checkbox within w_rp_tj end type type dw_1 from u_dw_rbtnfilter within w_rp_tj end type type sle_mtrl from singlelineedit within w_rp_tj end type type sle_cust from singlelineedit within w_rp_tj end type type st_mtrl from statictext within w_rp_tj end type type st_cust from statictext within w_rp_tj end type type cbx_loginretr from checkbox within w_rp_tj end type type pb_em1 from picturebutton within w_rp_tj end type type pb_em2 from picturebutton within w_rp_tj end type type pb_2 from picturebutton within w_rp_tj end type type cb_delete from uo_imflatbutton within w_rp_tj end type type cb_copyself from uo_imflatbutton within w_rp_tj end type type cb_save from uo_imflatbutton within w_rp_tj end type type cb_3 from uo_imflatbutton within w_rp_tj end type type tab_1 from tab within w_rp_tj end type type tabpage_1 from userobject within tab_1 end type type dw_2 from u_dw_rbtnfilter within tabpage_1 end type type tabpage_1 from userobject within tab_1 dw_2 dw_2 end type type tabpage_2 from userobject within tab_1 end type type dw_3 from u_dw_rbtnfilter within tabpage_2 end type type tabpage_2 from userobject within tab_1 dw_3 dw_3 end type type tab_1 from tab within w_rp_tj tabpage_1 tabpage_1 tabpage_2 tabpage_2 end type type gb_1 from groupbox within w_rp_tj end type type ln_bar from line within w_rp_tj end type type ln_bar2 from line within w_rp_tj end type type r_bar from rectangle within w_rp_tj end type type ln_1 from line within w_rp_tj end type type ln_2 from line within w_rp_tj end type type ln_3 from line within w_rp_tj end type type ln_4 from line within w_rp_tj end type end forward global type w_rp_tj from w_publ_base integer x = 270 integer y = 136 integer width = 3982 integer height = 2404 string title = "报表统计" boolean maxbox = true boolean resizable = true windowstate windowstate = maximized! event ue_filter ( ) event ue_sort ( ) event ue_sentdataout ( ) event ue_date1 ( ) event ue_date2 ( ) event ue_date3 ( ) event ue_help ( ) event user_key ( ) event ue_date4 ( ) cb_2 cb_2 cb_psetup cb_psetup cb_1 cb_1 st_3 st_3 st_4 st_4 em_1 em_1 em_2 em_2 ddlb_yl ddlb_yl cbx_yl cbx_yl dw_1 dw_1 sle_mtrl sle_mtrl sle_cust sle_cust st_mtrl st_mtrl st_cust st_cust cbx_loginretr cbx_loginretr pb_em1 pb_em1 pb_em2 pb_em2 pb_2 pb_2 cb_delete cb_delete cb_copyself cb_copyself cb_save cb_save cb_3 cb_3 tab_1 tab_1 gb_1 gb_1 ln_bar ln_bar ln_bar2 ln_bar2 r_bar r_bar ln_1 ln_1 ln_2 ln_2 ln_3 ln_3 ln_4 ln_4 end type global w_rp_tj w_rp_tj type variables Boolean if_mdf_title = TRUE Boolean cb_reol Boolean if_retrieveing = FALSE //是否正在retrieve String cur_vspos Boolean if_power_sendout = true Boolean if_power_print = true //////////////// string s_col="",s_text="" integer l_row=0 integer rp_dw_row integer rp_rptype long rp_rpid long rp_billid integer left_or_right long ll_dw3_row long rowid long rpid integer rowcode string rowname integer rowtype integer rowcmpltype string Rowformula1 string Rowformula2 uo_rp uo_this_rp datawindow dw_2,dw_3 end variables forward prototypes public function integer days_in_month (integer month, integer year) public function integer wf_replacedw () public subroutine f_bulid_rp (integer row) public subroutine f_get_rpid () public function string of_globalreplace (string as_source, string as_old, string as_new) public function decimal of_sqlstring (string arg_sqlstring, string arg_star, string arg_end) public function string of_globalreplace1 (string as_source, string as_old, string as_new) public function string f_ss (string arg_s, string arg_colname) public function string f_sss (string arg_s) public subroutine wf_retrieve_mx (long arg_rpid) public subroutine f_bulid_rp_history (long arg_billid) public subroutine wf_lock_child () end prototypes event ue_filter;call super::ue_filter;OPENWITHPARM(w_filter_query,dw_1) STRING LS_EXPR LS_EXPR=Message.StringParm if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return dw_1.setfilter(LS_EXPR) dw_1.SetRedraw (false) dw_1.filter() dw_1.SetRedraw (TRUE) end event event ue_sort();OPENwithparm(w_sortrow,DW_1) STRING LS_EXPR LS_EXPR=Message.StringParm IF ISNULL(LS_EXPR) THEN LS_EXPR=' ' if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return dw_1.setsort(LS_EXPR) dw_1.SetRedraw (false) dw_1.sort() dw_1.SetRedraw (true) end event event ue_sentdataout;IF NOT f_power_ind(1822) THEN MessageBox('提示','你没有使用权限!', Information!, OK! ) RETURN END IF OpenWithParm(w_sentdataout,DW_1) end event event ue_date1();//IF THIS.Text = "本日" THEN em_1.text = string(today(),"yyyy-mm-dd") em_2.text = string(today(),"yyyy-mm-dd") //ELSEIF THIS.Text = "本周" THEN // int li_DayNum // li_DayNum = DayNumber(today()) // em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd") // em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd") //ELSEIF THIS.Text = "本月" THEN // int li_Month, li_Year, li_Days // li_Month = Month(today()) // li_Year = Year(today()) // li_Days = days_in_month(li_Month, li_Year) // em_1.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd") // em_2.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd") //END IF end event event ue_date2();//IF THIS.Text = "本日" THEN // em_1.text = string(today(),"yyyy-mm-dd") // em_2.text = string(today(),"yyyy-mm-dd") //ELSEIF THIS.Text = "本周" THEN int li_DayNum li_DayNum = DayNumber(today()) em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd") em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd") //ELSEIF THIS.Text = "本月" THEN // int li_Month, li_Year, li_Days // li_Month = Month(today()) // li_Year = Year(today()) // li_Days = days_in_month(li_Month, li_Year) // em_1.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd") // em_2.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd") //END IF end event event ue_date3();//IF THIS.Text = "本日" THEN // em_1.text = string(today(),"yyyy-mm-dd") // em_2.text = string(today(),"yyyy-mm-dd") //ELSEIF THIS.Text = "本周" THEN // int li_DayNum // li_DayNum = DayNumber(today()) // em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd") // em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd") //ELSEIF THIS.Text = "本月" THEN int li_Month, li_Year, li_Days li_Month = Month(today()) li_Year = Year(today()) li_Days = days_in_month(li_Month, li_Year) em_1.text = string(Date(li_Year, li_Month, 1),"yyyy-mm-dd") em_2.text = string(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd") //END IF end event event ue_help();Int i i = htmlhelpA(Handle(THIS), sys_help_chm, 0, THIS.Title+".html") end event event user_key();IF KeyDown(KeyF1!) THEN THIS.TriggerEvent('ue_help') end if end event event ue_date4();//IF THIS.Text = "本日" THEN // em_1.text = string(today(),"yyyy-mm-dd") // em_2.text = string(today(),"yyyy-mm-dd") //ELSEIF THIS.Text = "本周" THEN // int li_DayNum // li_DayNum = DayNumber(today()) // em_1.text = string(RelativeDate ( today(), 1 - li_DayNum ),"yyyy-mm-dd") // em_2.text = string(RelativeDate ( today(), 7 - li_DayNum ),"yyyy-mm-dd") //ELSEIF THIS.Text = "本月" THEN Int li_Month, li_Year, li_Days li_Month = Month(Today()) li_Year = Year(Today()) IF li_Month = 1 THEN li_Month = 12 li_Year = li_Year - 1 ELSE li_Month -= 1 END IF li_Days = days_in_month(li_Month, li_Year) em_1.Text = String(Date(li_Year, li_Month, 1),"yyyy-mm-dd") em_2.Text = String(Date(li_Year, li_Month, li_Days),"yyyy-mm-dd") //END IF end event public function integer days_in_month (integer month, integer year);//Most cases are straight forward in that there are a fixed number of //days in 11 of the 12 months. February is, of course, the problem. //In a leap year February has 29 days, otherwise 28. Integer li_DaysInMonth, li_Days[12] = {31,28,31,30,31,30,31,31,30,31,30,31} // Get the number of days per month for a non leap year. li_DaysInMonth = li_Days[Month] // Check for a leap year. If Month = 2 Then // If the year is a leap year, change the number of days. // Leap Year Calculation: // Year divisible by 4, but not by 100, unless it is also divisible by 400 If ( (Mod(Year,4) = 0 And Mod(Year,100) <> 0) Or (Mod(Year,400) = 0) ) Then li_DaysInMonth = 29 End If End If //Return the number of days in the relevant month Return li_DaysInMonth end function public function integer wf_replacedw ();String ls_windowname ls_windowname = THIS.ClassName ( ) String ls_old_dwname,ls_new_dwname = '' ls_old_dwname = dw_1.DataObject ls_new_dwname = f_get_dwprint_dynamic_chname(ls_old_dwname,ls_windowname) IF ls_new_dwname = '' THEN ls_new_dwname = ls_old_dwname END IF dw_1.DataObject = ls_new_dwname dw_1.SetTransObject(sqlca) dw_1.uf_read_profile_layout() f_title_change(dw_1) RETURN 1 end function public subroutine f_bulid_rp (integer row);IF row <= 0 THEN RETURN f_get_rpid() dw_1.Reset() //dw_1.Object.rpid[row] //messagebox("",string("sql_l1.text ='" + dw_1.Object.col1name1[row] + "'")) dw_1.Object.Title.Text = dw_2.Object.rpname[row] dw_1.Modify("Colname_l_t.text ='" + dw_2.Object.col1name0[row] + "'") dw_1.Modify("Amt_l1_t.text ='" + dw_2.Object.col1name1[row] + "'") dw_1.Modify("Amt_l2_t.text ='" + dw_2.Object.col1name2[row] + "'") dw_1.Modify("Colname_r_t.text='" + dw_2.Object.col2name0[row] + "'") dw_1.Modify("Amt_r1_t.text ='" + dw_2.Object.col2name1[row] + "'") dw_1.Modify("Amt_r2_t.text ='" + dw_2.Object.col2name2[row] + "'") IF dw_2.Object.rptype[row] = 0 THEN dw_1.Modify('Colname_l.width = 1300') dw_1.Modify('compute_1.width =200') dw_1.Modify('Amt_l1.width = 800') dw_1.Modify('Amt_l2.width = 800') ELSE dw_1.Modify('Colname_l.width = 667') dw_1.Modify('compute_1.width =200') dw_1.Modify('Amt_l1.width = 348') dw_1.Modify('Amt_l2.width = 348') dw_1.Modify('Colname_r.width = 667') dw_1.Modify('compute_2.width =200') dw_1.Modify('Amt_r1.width = 348') dw_1.Modify('Amt_r2.width = 348') END IF Integer ll_rowcount,ll_i Integer s_rowcode String s_rowname Integer l_rowtype Integer l_rowcmpltype String s_Rowformula1 String s_Rowformula2 IF dw_2.Object.rptype[row] = 0 THEN dw_1.Modify("colname_r.Visible = 0") dw_1.Modify("compute_2.Visible = 0") dw_1.Modify("Amt_r1.Visible =0") dw_1.Modify("Amt_r2.Visible = 0") SELECT Max(rowcode) Into :ll_rowcount From u_rp_rowdef Where rpid = :rp_rpid; FOR ll_i = 1 To ll_rowcount dw_1.InsertRow(0) //左 rowname = "" Rowformula1 = "" Rowformula2 = "" SELECT rowname,Rowformula1,Rowformula2 Into :s_rowname,:s_Rowformula1,:s_Rowformula2 From u_rp_rowdef Where rpid = :rp_rpid And rowcmpltype = 0 And rowcode = :ll_i ; dw_1.Object.Colname_l[ll_i] = s_rowname NEXT ELSE dw_1.Modify("colname_r.Visible = 1") dw_1.Modify("compute_2.Visible = 1") dw_1.Modify("Amt_r1.Visible =1") dw_1.Modify("Amt_r2.Visible = 1") SELECT Max(rowcode) Into :ll_rowcount From u_rp_rowdef Where rpid = :rp_rpid; FOR ll_i = 1 To ll_rowcount dw_1.InsertRow(0) //左 rowname = "" Rowformula1 = "" Rowformula2 = "" SELECT rowname,Rowformula1,Rowformula2 Into :s_rowname,:s_Rowformula1,:s_Rowformula2 From u_rp_rowdef Where rpid = :rp_rpid And rowcmpltype = 0 And rowcode = :ll_i ; dw_1.Object.Colname_l[ll_i] = s_rowname //右 rowname = "" Rowformula1 = "" Rowformula2 = "" SELECT rowname,Rowformula1,Rowformula2 Into :s_rowname,:s_Rowformula1,:s_Rowformula2 From u_rp_rowdef Where rpid = :rp_rpid And rowcmpltype = 1 And rowcode = :ll_i ; dw_1.Object.Colname_r[ll_i] = s_rowname NEXT END IF end subroutine public subroutine f_get_rpid ();Long ll_row, ll_i FOR ll_i = dw_2.RowCount() To 1 Step -1 IF dw_2.IsSelected(ll_i) THEN ll_row = ll_i END IF NEXT IF ll_row <= 0 THEN RETURN rp_rpid = dw_2.Object.rpid[ll_row] rp_rptype= dw_2.Object.rptype[ll_row] end subroutine public function string of_globalreplace (string as_source, string as_old, string as_new);long ll_oldlen, ll_newlen, ll_pos ll_pos = Pos(as_source,as_old) IF ll_pos > 0 Then ll_oldlen = Len(as_old) ll_newlen = Len(as_new) DO WHILE ll_pos > 0 as_source = Replace(as_source,ll_pos,ll_oldlen,as_new) ll_pos = Pos(as_source,as_old,ll_pos + ll_newlen) LOOP END IF RETURN as_source end function public function decimal of_sqlstring (string arg_sqlstring, string arg_star, string arg_end);Transaction commit_transaction commit_transaction = Create Transaction commit_transaction = sqlca Decimal jine=0 long uc_row,i String t_star, t_end,sqlstring,Name sqlstring = Trim(string(arg_sqlstring)) sqlstring = of_globalreplace(sqlstring,"@开始日期@",String(arg_star)) sqlstring = of_globalreplace(sqlstring,"@结束日期@",String(arg_end)) //messagebox("",sqlstring) DECLARE c1 Dynamic Cursor FOR SQLSA; PREPARE SQLSA From :sqlstring Using commit_transaction; OPEN Dynamic c1 ; Lable: FETCH c1 Into :jine; IF sqlca.SQLCode = 0 THEN //如果成功取出记录 GOTO Lable //取下一条 END IF CLOSE c1; //关闭游标 if isnull(jine)=true then jine=0 return jine end function public function string of_globalreplace1 (string as_source, string as_old, string as_new);long ll_oldlen, ll_newlen, ll_pos ll_pos = Pos(as_source,as_old) IF ll_pos > 0 Then ll_oldlen = Len(as_old) ll_newlen = Len(as_new) as_source = Replace(as_source,ll_pos,ll_oldlen,as_new) ll_pos = Pos(as_source,as_old,ll_pos + ll_newlen) END IF RETURN as_source end function public function string f_ss (string arg_s, string arg_colname); String s_rslt,s_s,s_s1,ls_s,ls_e String ss1,ss2,sss String s1,s2 Integer i,j,arg_i,xx Decimal LName FOR i = 1 To Len(arg_s) ls_s = Mid(arg_s,i,1) IF ls_s = "[" THEN FOR j = i To Len(arg_s) ls_e = Mid(arg_s,j,1) IF ls_e = "]" THEN // IF ls_e = "[" THEN // i = j // END IF s_s = Mid(arg_s,i + 1,j - i -1) IF Pos(s_s,":") > 0 THEN ss1 = Left(s_s,Pos(s_s,":") - 1) ss2 = Right(s_s,Len(s_s) - Pos(s_s,":")) FOR xx = Long(ss1) To Long(ss2) sss = sss + "[" + String(xx) + "]" NEXT // IF arg_i <= Long(ss1) THEN // ss1 = String(Long(ss1) + 1) // // END IF // IF arg_i <= Long(ss2) THEN // ss2 = String(Long(ss2) + 1) // END IF arg_s = of_globalreplace1(arg_s,"[" +s_s + "]",sss) i = j - 1 EXIT ELSE IF Long(s_s) = 0 THEN s_rslt = "公式错误" GOTO ext END IF s_s1 = String(dec(dw_1.GetItemDecimal(Long(s_s), arg_colname))) s1 = Left(arg_s,i - 1) s2 = Right(arg_s,Len(arg_s) - i + 1) IF IsNull(s_s1) = False THEN s2 = of_globalreplace1(s2,"[" +s_s + "]","(" +s_s1 + ")" ) END IF arg_s = s1 + s2 i = j - 2 EXIT END IF END IF NEXT END IF NEXT s_rslt = arg_s ext: RETURN s_rslt end function public function string f_sss (string arg_s);String s_rslt,s_s,s_s1,ls_s,ls_e String ss1,ss2,sss,ssss String s1,s2 Integer i,j,arg_i,xx,xxx = 1 Decimal LName ext1: FOR i = xxx To Len(arg_s) ls_s = Mid(arg_s,i,1) IF ls_s = "[" THEN FOR j = i To Len(arg_s) ls_e = Mid(arg_s,j,1) IF ls_e = "[" THEN i = j END IF IF ls_e = "]" THEN s_s = Mid(arg_s,i + 1,j - i -1) IF Pos(s_s,":") > 0 THEN ss1 = Left(s_s,Pos(s_s,":") - 1) ss2 = Right(s_s,Len(s_s) - Pos(s_s,":")) FOR xx = Long(ss1) To Long(ss2) sss = sss + "[" + String(xx) + "]" IF xx <> Long(ss2) THEN sss = sss + "+" END IF NEXT arg_s = of_globalreplace1(arg_s,"[" +s_s + "]",sss) sss="" goto ext1 ELSE // ss1= "(" + s_s + ")" // // // arg_s = of_globalreplace(arg_s,"[" +s_s + "]",ss1 ) // // END IF // arg_s = s1 + s2 // i = j // EXIT END IF END IF NEXT END IF NEXT s_rslt = arg_s RETURN s_rslt end function public subroutine wf_retrieve_mx (long arg_rpid); end subroutine public subroutine f_bulid_rp_history (long arg_billid);String rpname //报表名称 Int rptype //报表类型 String col1name0 //左边第0列统计标题 String col1name1 //左边第1列统计标题 String col1name2 //左边第2列统计标题 String Col2name0 //右边第0列统计标题 String col2name1 //右边第1列统计标题 String col2name2 //右边第2列统计标题 datetime sdate,edate SELECT u_rp.rpname,u_rp.rptype,u_rp.col1name0,u_rp.col1name1,u_rp.col1name2,u_rp.Col2name0,u_rp.col2name1,u_rp.col2name2,u_sp_rp.sdate,u_sp_rp.edate INTO :rpname,:rptype,:col1name0,:col1name1,:col1name2,:Col2name0,:col2name1,:col2name2,:sdate,:edate From u_rp,u_sp_rp Where u_rp.rpid = u_sp_rp.rpid And u_sp_rp.billid = :arg_billid; dw_1.Reset() dw_1.Object.Title.Text = rpname dw_1.Modify("Colname_l_t.text ='" + col1name0 + "'") dw_1.Modify("Amt_l1_t.text ='" + col1name1 + "'") dw_1.Modify("Amt_l2_t.text ='" + col1name2 + "'") dw_1.Modify("Colname_r_t.text='" + Col2name0 + "'") dw_1.Modify("Amt_r1_t.text ='" + col2name1 + "'") dw_1.Modify("Amt_r2_t.text ='" + col2name2 + "'") IF rptype = 0 THEN dw_1.Modify('Colname_l.width = 1300') dw_1.Modify('compute_1.width =200') dw_1.Modify('Amt_l1.width = 800') dw_1.Modify('Amt_l2.width = 800') ELSE dw_1.Modify('Colname_l.width = 667') dw_1.Modify('compute_1.width =200') dw_1.Modify('Amt_l1.width = 348') dw_1.Modify('Amt_l2.width = 348') dw_1.Modify('Colname_r.width = 667') dw_1.Modify('compute_2.width =200') dw_1.Modify('Amt_r1.width = 348') dw_1.Modify('Amt_r2.width = 348') END IF Integer ll_rowcount,ll_i Integer s_rowcode String s_rowname Integer l_rowtype Integer l_rowcmpltype String s_Rowformula1 String s_Rowformula2 String ss_col1name0 //左边第0列统计标题 Decimal ll_col1name1 //左边第1列统计标题 Decimal ll_col1name2 //左边第2列统计标题 String ss_Col2name0 //右边第0列统计标题 Decimal ll_col2name1 //右边第1列统计标题 Decimal ll_col2name2 //右边第2列统计标题 SELECT Max(printid) Into :ll_rowcount From u_sp_rp_mx Where billid = :arg_billid; FOR ll_i = 1 To ll_rowcount dw_1.InsertRow(0) //左 ss_col1name0 = "" ll_col1name1 = 0 ll_col1name2 = 0 ss_Col2name0="" ll_col2name1=0 ll_col2name2=0 SELECT col1name0,col1name1,col1name2 ,Col2name0,col2name1,col2name2 Into :ss_col1name0,:ll_col1name1,:ll_col1name2 ,:ss_Col2name0,:ll_col2name1,:ll_col2name2 From u_sp_rp_mx Where billid = :arg_billid And printid = :ll_i ; dw_1.Object.Colname_l[ll_i]= ss_col1name0 dw_1.Object.amt_l1[ll_i] = ll_col1name1 dw_1.Object.amt_l2[ll_i] = ll_col1name2 dw_1.Object.Colname_r[ll_i]= ss_Col2name0 dw_1.Object.amt_r1[ll_i] = ll_col2name1 dw_1.Object.amt_r2[ll_i] = ll_col2name2 NEXT IF rptype = 0 THEN dw_1.Modify("colname_r.Visible = 0") dw_1.Modify("compute_2.Visible = 0") dw_1.Modify("Amt_r1.Visible =0") dw_1.Modify("Amt_r2.Visible = 0") ELSE dw_1.Modify("colname_r.Visible = 1") dw_1.Modify("compute_2.Visible = 1") dw_1.Modify("Amt_r1.Visible =1") dw_1.Modify("Amt_r2.Visible = 1") END IF dw_1.Object.dt_ar.Text = "日期范围: "+string(date(sdate))+" 到 "+string(date(edate)) dw_1.Object.t_company.Text ="编制单位:" + sys_message_username dw_1.Object.t_2.Text ="制表人:" + publ_operator end subroutine public subroutine wf_lock_child ();Int LS_INT IF dw_edit_mode = True THEN cb_3.text="放弃" cb_3.TriggerEvent('ue_textchange') cb_save.enabled=true FOR LS_INT = 1 To 20 dw_1.SetTabOrder (LS_INT,LS_INT * 10) NEXT FOR LS_INT = 1 To 20 dw_3.SetTabOrder (LS_INT,LS_INT * 10) NEXT ELSE cb_3.text="修改" cb_3.TriggerEvent('ue_textchange') cb_save.enabled=false FOR LS_INT = 1 To 20 dw_1.SetTabOrder (LS_INT,0) NEXT FOR LS_INT = 1 To 20 dw_3.SetTabOrder (LS_INT,0) NEXT END IF end subroutine on w_rp_tj.create int iCurrent call super::create this.cb_2=create cb_2 this.cb_psetup=create cb_psetup this.cb_1=create cb_1 this.st_3=create st_3 this.st_4=create st_4 this.em_1=create em_1 this.em_2=create em_2 this.ddlb_yl=create ddlb_yl this.cbx_yl=create cbx_yl this.dw_1=create dw_1 this.sle_mtrl=create sle_mtrl this.sle_cust=create sle_cust this.st_mtrl=create st_mtrl this.st_cust=create st_cust this.cbx_loginretr=create cbx_loginretr this.pb_em1=create pb_em1 this.pb_em2=create pb_em2 this.pb_2=create pb_2 this.cb_delete=create cb_delete this.cb_copyself=create cb_copyself this.cb_save=create cb_save this.cb_3=create cb_3 this.tab_1=create tab_1 this.gb_1=create gb_1 this.ln_bar=create ln_bar this.ln_bar2=create ln_bar2 this.r_bar=create r_bar this.ln_1=create ln_1 this.ln_2=create ln_2 this.ln_3=create ln_3 this.ln_4=create ln_4 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_2 this.Control[iCurrent+2]=this.cb_psetup this.Control[iCurrent+3]=this.cb_1 this.Control[iCurrent+4]=this.st_3 this.Control[iCurrent+5]=this.st_4 this.Control[iCurrent+6]=this.em_1 this.Control[iCurrent+7]=this.em_2 this.Control[iCurrent+8]=this.ddlb_yl this.Control[iCurrent+9]=this.cbx_yl this.Control[iCurrent+10]=this.dw_1 this.Control[iCurrent+11]=this.sle_mtrl this.Control[iCurrent+12]=this.sle_cust this.Control[iCurrent+13]=this.st_mtrl this.Control[iCurrent+14]=this.st_cust this.Control[iCurrent+15]=this.cbx_loginretr this.Control[iCurrent+16]=this.pb_em1 this.Control[iCurrent+17]=this.pb_em2 this.Control[iCurrent+18]=this.pb_2 this.Control[iCurrent+19]=this.cb_delete this.Control[iCurrent+20]=this.cb_copyself this.Control[iCurrent+21]=this.cb_save this.Control[iCurrent+22]=this.cb_3 this.Control[iCurrent+23]=this.tab_1 this.Control[iCurrent+24]=this.gb_1 this.Control[iCurrent+25]=this.ln_bar this.Control[iCurrent+26]=this.ln_bar2 this.Control[iCurrent+27]=this.r_bar this.Control[iCurrent+28]=this.ln_1 this.Control[iCurrent+29]=this.ln_2 this.Control[iCurrent+30]=this.ln_3 this.Control[iCurrent+31]=this.ln_4 end on on w_rp_tj.destroy call super::destroy destroy(this.cb_2) destroy(this.cb_psetup) destroy(this.cb_1) destroy(this.st_3) destroy(this.st_4) destroy(this.em_1) destroy(this.em_2) destroy(this.ddlb_yl) destroy(this.cbx_yl) destroy(this.dw_1) destroy(this.sle_mtrl) destroy(this.sle_cust) destroy(this.st_mtrl) destroy(this.st_cust) destroy(this.cbx_loginretr) destroy(this.pb_em1) destroy(this.pb_em2) destroy(this.pb_2) destroy(this.cb_delete) destroy(this.cb_copyself) destroy(this.cb_save) destroy(this.cb_3) destroy(this.tab_1) destroy(this.gb_1) destroy(this.ln_bar) destroy(this.ln_bar2) destroy(this.r_bar) destroy(this.ln_1) destroy(this.ln_2) destroy(this.ln_3) destroy(this.ln_4) end on event resize;ln_bar.endx = this.width ln_bar2.endx = this.width ln_1.endx = this.width ln_2.endx = this.width ln_3.endx = this.width ln_4.endx = this.width r_bar.width = this.width dw_1.width=this.width - dw_1.x - 40 dw_1.height=this.height - dw_1.y - 150 //dw_2.width=this.width - dw_2.x - 40 tab_1.height=this.height - tab_1.y - 150 dw_2.height=this.height - dw_2.y - 150 dw_3.height=this.height - dw_3.y - 150 end event event open;call super::open;dw_2 = tab_1.tabpage_1.dw_2 dw_3 = tab_1.tabpage_2.dw_3 dw_1.SetTransObject (sqlca) dw_2.SetTransObject (sqlca) dw_3.SetTransObject (sqlca) dw_2.Retrieve() uo_this_rp = create uo_rp IF dw_1.Describe("DataWindow.Objects") = "" THEN dw_1.DataObject = '' EM_1.Text = String(Today(),'YYYY-MM-01') EM_2.Text = String(Today(),'YYYY-MM-DD') dw_1.RBUTTON_FILTER_USE = TRUE //右键查询功能开关 IF Trim(dw_1.DataObject) <> '' THEN dw_1.Object.DataWindow.Print.MARGIN.Top = Integer(f_ProfileString(sys_empid,dw_1.DataObject, "MARGIN_TOP", "110")) dw_1.Object.DataWindow.Print.MARGIN.Left = Integer(f_ProfileString(sys_empid,dw_1.DataObject, "MARGIN_LEFT", "96" )) dw_1.Object.DataWindow.Print.MARGIN.bottom = Integer(f_ProfileString(sys_empid,dw_1.DataObject, "MARGIN_BOTTOM", "110")) dw_1.Object.DataWindow.Print.MARGIN.Right = Integer(f_ProfileString(sys_empid,dw_1.DataObject, "MARGIN_RIGHT", "96" )) END IF //IF cbx_loginretr.Checked THEN // cb_1.TriggerEvent(Clicked!) //END IF s_edit_index_tran s_tran s_tran = Message.PowerObjectParm IF NOT IsNull(s_tran) THEN if_power_sendout = s_tran.if_sendout if_power_print = s_tran.if_print END IF dw_3.retrieve(rp_rpid) wf_lock_child() end event event activate;IF Trim(dw_1.DataObject) <> '' THEN IF cbx_yl.Enabled AND cbx_yl.Visible THEN cbx_yl.TriggerEvent(Clicked!) END IF end event event key;call super::key;this.TRIGGEREVENT('USER_KEY') end event type cb_func from w_publ_base`cb_func within w_rp_tj integer x = 160 integer width = 192 integer height = 164 string text = "Excel" end type event cb_func::clicked;call super::clicked; parent.triggerevent('ue_sentdataout') end event type cb_exit from w_publ_base`cb_exit within w_rp_tj integer x = 1874 integer width = 151 integer height = 164 integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type cb_2 from uo_imflatbutton within w_rp_tj integer x = 1719 integer width = 151 integer height = 164 integer taborder = 90 string text = "打印" string normalpicname = "print.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked; IF Not f_power_ind(1831) THEN MessageBox('提示','你没有使用权限!', Information!, OK! ) RETURN END IF IF DW_1.RowCount() >= 1 THEN cbx_YL.Checked = TRUE cbx_YL.TriggerEvent(Clicked!) OpenWithParm(w_sys_printpagesetting,DW_1) ELSE MessageBox('NO','数据窗口中没有任何记录,不能打印!') END IF IF Trim(DW_1.DataObject) = '' THEN RETURN f_SetProfileString (sys_empid,DW_1.DataObject, "MARGIN_TOP", String(DW_1.Object.DataWindow.Print.MARGIN.Top)) f_SetProfileString (sys_empid,DW_1.DataObject, "MARGIN_LEFT", String(DW_1.Object.DataWindow.Print.MARGIN.Left)) f_SetProfileString (sys_empid,DW_1.DataObject, "MARGIN_BOTTOM", String(DW_1.Object.DataWindow.Print.MARGIN.BOTTOM)) f_SetProfileString (sys_empid,DW_1.DataObject, "MARGIN_RIGHT", String(DW_1.Object.DataWindow.Print.MARGIN.Right)) end event type cb_psetup from uo_imflatbutton within w_rp_tj integer x = 1449 integer width = 256 integer height = 164 integer taborder = 80 string text = "页面设置" string normalpicname = "PRINTFLD.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;s_print_value s_print s_print.obj_dw = DW_1 s_print.dft_printername = '' OpenWithParm(w_sys_printpage_value,s_print) end event type cb_1 from uo_imflatbutton within w_rp_tj integer width = 165 integer height = 164 integer taborder = 40 string text = "统计" string normalpicname = "refresh.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;Int i,uc_row String t_star,t_end IF rp_rpid <= 0 THEN RETURN t_star = "'" + String(Date(em_1.Text)) + " 00:00:00'" t_end = "'" + String(Date(em_2.Text )) + " 23:59:59'" IF IsNull(t_star) Or IsNull(t_end) THEN MessageBox("Error","请,设置统计开始和结束日期") RETURN 0 END IF f_bulid_rp(rp_dw_row) String s_Rowformula1,s_Rowformula2 Integer ll_i ////////// //先算sql FOR ll_i = 1 To dw_1.RowCount() IF rp_rptype = 0 THEN //单列 s_Rowformula1 = "" s_Rowformula2 = "" SELECT Rowformula1,Rowformula2 Into :s_Rowformula1,:s_Rowformula2 From u_rp_rowdef Where rpid = :rp_rpid And rowcmpltype = 0 And rowcode = :ll_i ; IF IsNull(s_Rowformula1) THEN s_Rowformula1 = "" IF IsNull(s_Rowformula2) THEN s_Rowformula2 = "" IF s_Rowformula1 <> "" THEN dw_1.Object.Amt_l1[ll_i] = of_sqlstring(s_Rowformula1,t_star,t_end) IF s_Rowformula2 <> "" THEN dw_1.Object.Amt_l2[ll_i] = of_sqlstring(s_Rowformula2,t_star,t_end) ELSEIF rp_rptype = 1 THEN //双列 s_Rowformula1 = "" s_Rowformula2 = "" SELECT Rowformula1,Rowformula2 Into :s_Rowformula1,:s_Rowformula2 From u_rp_rowdef Where rpid = :rp_rpid And rowcmpltype = 0 And rowcode = :ll_i ; IF IsNull(s_Rowformula1) THEN s_Rowformula1 = "" IF IsNull(s_Rowformula2) THEN s_Rowformula2 = "" IF s_Rowformula1 <> "" THEN dw_1.Object.Amt_l1[ll_i] = of_sqlstring(s_Rowformula1,t_star,t_end) IF s_Rowformula2 <> "" THEN dw_1.Object.Amt_l2[ll_i] = of_sqlstring(s_Rowformula2,t_star,t_end) s_Rowformula1 = "" s_Rowformula2 = "" SELECT Rowformula1,Rowformula2 Into :s_Rowformula1,:s_Rowformula2 From u_rp_rowdef Where rpid = :rp_rpid And rowcmpltype = 1 And rowcode = :ll_i ; IF IsNull(s_Rowformula1) THEN s_Rowformula1 = "" IF IsNull(s_Rowformula2) THEN s_Rowformula2 = "" IF s_Rowformula1 <> "" THEN dw_1.Object.Amt_r1[ll_i] = of_sqlstring(s_Rowformula1,t_star,t_end) IF s_Rowformula2 <> "" THEN dw_1.Object.Amt_r2[ll_i] = of_sqlstring(s_Rowformula2,t_star,t_end) END IF NEXT //////// // FOR i = 1 To 10 dw_1.AcceptText() FOR ll_i = 1 To dw_1.RowCount() IF ll_i = 2 THEN ll_i = 2 END IF IF rp_rptype = 0 THEN //单列 s_Rowformula1 = "" s_Rowformula2 = "" SELECT Rowformula1,Rowformula2 Into :s_Rowformula1,:s_Rowformula2 From u_rp_rowdef Where rpid = :rp_rpid And rowcmpltype = 0 And rowcode = :ll_i ; IF IsNull(s_Rowformula1) THEN s_Rowformula1 = "" IF IsNull(s_Rowformula2) THEN s_Rowformula2 = "" // IF Pos(s_Rowformula1,"[") > 0 And Pos(s_Rowformula1,"]") > 0 THEN IF Pos(s_Rowformula1,":") > 0 THEN s_Rowformula1 = f_sss(s_Rowformula1) IF IsNull(dw_1.Object.Amt_l1[ll_i]) = True Or dw_1.Object.Amt_l1[ll_i] = 0 THEN IF f_rp_excute(f_ss(s_Rowformula1,"amt_l1")) <> "error" THEN dw_1.Object.Amt_l1[ll_i] = Dec(f_rp_excute(f_ss(s_Rowformula1,"amt_l1"))) END IF END IF ELSE IF IsNull(dw_1.Object.Amt_l1[ll_i]) = True THEN dw_1.Object.Amt_l1[ll_i] = Dec(of_sqlstring(s_Rowformula1,t_star,t_end)) END IF END IF // // IF Pos(s_Rowformula2,"[") > 0 And Pos(s_Rowformula2,"]") > 0 THEN IF Pos(s_Rowformula2,":") > 0 THEN s_Rowformula2 = f_sss(s_Rowformula2) IF IsNull(dw_1.Object.Amt_l2[ll_i]) = True Or dw_1.Object.Amt_l2[ll_i] = 0 THEN IF f_rp_excute(f_ss(s_Rowformula2,"amt_l2")) <> "error" THEN dw_1.Object.Amt_l2[ll_i] = Dec(f_rp_excute(f_ss(s_Rowformula2,"amt_l2"))) END IF END IF ELSE IF IsNull(dw_1.Object.Amt_l2[ll_i]) = True THEN dw_1.Object.Amt_l2[ll_i] = of_sqlstring(s_Rowformula2,t_star,t_end) END IF END IF // ELSEIF rp_rptype = 1 THEN //双列 s_Rowformula1 = "" s_Rowformula2 = "" SELECT Rowformula1,Rowformula2 Into :s_Rowformula1,:s_Rowformula2 From u_rp_rowdef Where rpid = :rp_rpid And rowcmpltype = 0 And rowcode = :ll_i ; IF IsNull(s_Rowformula1) THEN s_Rowformula1 = "" IF IsNull(s_Rowformula2) THEN s_Rowformula2 = "" // IF Pos(s_Rowformula1,"[") > 0 And Pos(s_Rowformula1,"]") > 0 THEN IF Pos(s_Rowformula1,":") > 0 THEN s_Rowformula1 = f_sss(s_Rowformula1) IF dw_1.Object.Amt_l1[ll_i] = 0 THEN IF ll_i = 17 THEN ll_i = 17 END IF IF f_rp_excute(f_ss(s_Rowformula1,"amt_l1")) <> "error" THEN dw_1.Object.Amt_l1[ll_i] = Dec(f_rp_excute(f_ss(s_Rowformula1,"amt_l1"))) END IF END IF ELSE IF IsNull(dw_1.Object.Amt_l1[ll_i]) = True THEN dw_1.Object.Amt_l1[ll_i] = Dec(of_sqlstring(s_Rowformula1,t_star,t_end)) END IF END IF // // IF Pos(s_Rowformula2,"[") > 0 And Pos(s_Rowformula2,"]") > 0 THEN IF Pos(s_Rowformula2,":") > 0 THEN s_Rowformula2 = f_sss(s_Rowformula2) IF dw_1.Object.Amt_l2[ll_i] = 0 THEN IF f_rp_excute(f_ss(s_Rowformula2,"amt_l2")) <> "error" THEN dw_1.Object.Amt_l2[ll_i] = Dec(f_rp_excute(f_ss(s_Rowformula2,"amt_l2"))) END IF END IF ELSE IF IsNull(dw_1.Object.Amt_l2[ll_i]) = True THEN dw_1.Object.Amt_l2[ll_i] = Dec(of_sqlstring(s_Rowformula2,t_star,t_end)) END IF END IF // s_Rowformula1 = "" s_Rowformula2 = "" SELECT Rowformula1,Rowformula2 Into :s_Rowformula1,:s_Rowformula2 From u_rp_rowdef Where rpid = :rp_rpid And rowcmpltype = 1 And rowcode = :ll_i ; IF IsNull(s_Rowformula1) THEN s_Rowformula1 = "" IF IsNull(s_Rowformula2) THEN s_Rowformula2 = "" // IF Pos(s_Rowformula1,"[") > 0 And Pos(s_Rowformula1,"]") > 0 THEN IF Pos(s_Rowformula1,":") > 0 THEN s_Rowformula1 = f_sss(s_Rowformula1) IF dw_1.Object.Amt_r1[ll_i] = 0 THEN IF f_rp_excute(f_ss(s_Rowformula1,"amt_r1")) <> "error" THEN dw_1.Object.Amt_r1[ll_i] = Dec(f_rp_excute(f_ss(s_Rowformula1,"amt_r1"))) END IF END IF ELSE IF IsNull(dw_1.Object.Amt_r1[ll_i]) = True THEN dw_1.Object.Amt_r1[ll_i] = Dec(of_sqlstring(s_Rowformula1,t_star,t_end)) END IF END IF // // IF Pos(s_Rowformula2,"[") > 0 And Pos(s_Rowformula2,"]") > 0 THEN IF Pos(s_Rowformula2,":") > 0 THEN s_Rowformula2 = f_sss(s_Rowformula2) IF dw_1.Object.Amt_r2[ll_i] = 0 THEN IF f_rp_excute(f_ss(s_Rowformula2,"amt_r2")) <> "error" THEN dw_1.Object.Amt_r2[ll_i] = Dec(f_rp_excute(f_ss(s_Rowformula2,"amt_r2"))) END IF END IF ELSE IF IsNull(dw_1.Object.Amt_r2[ll_i]) = True THEN dw_1.Object.Amt_r2[ll_i] = Dec( of_sqlstring(s_Rowformula2,t_star,t_end)) END IF END IF // END IF NEXT NEXT dw_1.Object.dt_ar.Text = "日期范围: "+em_1.Text+" 到 "+em_2.Text dw_1.Object.t_company.Text = "编制单位:" + sys_message_username dw_1.Object.t_2.Text = "制表人:" + publ_operator end event type st_3 from statictext within w_rp_tj integer x = 18 integer y = 208 integer width = 201 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 boolean enabled = false string text = "日期从:" alignment alignment = right! boolean focusrectangle = false end type type st_4 from statictext within w_rp_tj integer x = 727 integer y = 208 integer width = 105 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 boolean enabled = false string text = "到:" alignment alignment = right! boolean focusrectangle = false end type type em_1 from editmask within w_rp_tj integer x = 219 integer y = 192 integer width = 407 integer height = 88 integer taborder = 100 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! maskdatatype maskdatatype = datemask! string mask = "yyyy-mm-dd" boolean spin = true end type event rbuttondown;s_calender_arg s_calender s_calender.PointerX = THIS.PointerX() s_calender.PointerY = THIS.PointerY() s_calender.X = THIS.X s_calender.Y = THIS.Y OpenWithParm(w_calendar,s_calender) THIS.Text = String(id_date_selected) end event type em_2 from editmask within w_rp_tj event ue_enchange pbm_enchange integer x = 832 integer y = 192 integer width = 407 integer height = 88 integer taborder = 110 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! maskdatatype maskdatatype = datemask! string mask = "yyyy-mm-dd" boolean spin = true end type event ue_enchange;Integer li_year,li_month,li_day Date ld_lastday String s_str,s1_str IF IsDate(This.Text) = False THEN s1_str = Right(This.Text,1) s1_str = String(Long(s1_str) - 3) s_str= Left(This.Text,Len(This.Text) - 1) + s1_str ld_lastday = Date(s_str) li_year = Year(ld_lastday) li_month = Month(ld_lastday) + 1 //下一个月 IF li_month > 12 THEN //跨年度 li_year = li_year + 1 END IF li_month = Mod(li_month,12) li_day = 1 //每个月都是从1号开始 ld_lastday = RelativeDate( Date(li_year, li_month, li_day), -1 ) This.Text = String(ld_lastday) END IF end event event rbuttondown;s_calender_arg s_calender s_calender.PointerX = THIS.PointerX() s_calender.PointerY = THIS.PointerY() s_calender.X = THIS.X s_calender.Y = THIS.Y OpenWithParm(w_calendar,s_calender) THIS.Text = String(id_date_selected) end event type ddlb_yl from dropdownlistbox within w_rp_tj integer x = 2281 integer y = 16 integer width = 261 integer height = 532 integer taborder = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean enabled = false string text = "适当大小" boolean vscrollbar = true string item[] = {"100%","75%","50%","25%","200%","150%"} borderstyle borderstyle = stylelowered! end type event selectionchanged;dw_1.Object.DataWindow.Print.Preview.Zoom = INTEGER(LEFT(TRIM(this.text),LEN(TRIM(this.text)) - 1)) dw_1.object.DataWindow.Print.Preview = 'yes' end event event constructor;if THIS.TotalItems ( )>=1 then THIS.SelectItem(1) end event type cbx_yl from checkbox within w_rp_tj integer x = 2062 integer y = 20 integer width = 206 integer height = 76 integer taborder = 70 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "预览" end type event clicked;try ddlb_yl.Enabled = THIS.Checked IF THIS.Checked THEN IF Lower(dw_1.Object.DataWindow.Print.Preview) = 'yes' THEN RETURN dw_1.Object.DataWindow.Print.Preview = 'yes' dw_1.Object.DataWindow.Print.Preview.Rulers = "yes" ELSE IF Lower(dw_1.Object.DataWindow.Print.Preview) = 'no' THEN RETURN dw_1.Object.DataWindow.Print.Preview = 'NO' END IF catch(runtimeerror e) end try end event event constructor;THIS.BackColor = 14215660 end event type dw_1 from u_dw_rbtnfilter within w_rp_tj integer x = 1257 integer y = 420 integer width = 2656 integer height = 1820 boolean bringtotop = true string dataobject = "dw_open_rp" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序功能开关 RBUTTON_FILTER_USE=true //右键查询功能开关 end event event retrievestart;call super::retrievestart;cb_reol = cb_1.Enabled cb_1.Enabled = FALSE if_retrieveing = TRUE cur_vspos = THIS.Describe("DataWindow.VerticalScrollPosition") end event event retrieveend;call super::retrieveend;cb_1.Enabled = cb_reol if_retrieveing = FALSE IF Dec(cur_vspos) > 0 THEN THIS.Modify("DataWindow.VerticalScrollPosition="+cur_vspos) END IF end event event doubleclicked;call super::doubleclicked;if if_mdf_title then if LOWER(LEFT(dwo.type,4))='text' then s_inputbox S_SREU STRING LS_STR,column_name S_SREU.TITLE='目前标题为: '+dwo.TEXT+' 。请输入新标题: ' S_SREU.OLD_TEXT=dwo.TEXT column_name=DWO.NAME openwithparm(w_inputbox,S_SREU) LS_STR=Message.StringParm if trim(LS_STR)<>'' AND dwo.TEXT<>LS_STR then THIS.Modify(column_name+'.text="'+LS_STR+'"') END IF end if end if end event event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) END IF end event event dwnkey;call super::dwnkey;PARENT.TRIGGEREVENT('USER_KEY') end event type sle_mtrl from singlelineedit within w_rp_tj boolean visible = false integer x = 1637 integer y = 308 integer width = 677 integer height = 84 integer taborder = 120 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 sle_cust from singlelineedit within w_rp_tj boolean visible = false integer x = 475 integer y = 308 integer width = 677 integer height = 84 integer taborder = 130 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 st_mtrl from statictext within w_rp_tj boolean visible = false integer x = 1179 integer y = 324 integer width = 453 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "物料编码/名称含:" alignment alignment = right! boolean focusrectangle = false end type type st_cust from statictext within w_rp_tj boolean visible = false integer x = 14 integer y = 324 integer width = 453 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "客户编号/名称含:" boolean focusrectangle = false end type type cbx_loginretr from checkbox within w_rp_tj string tag = "此项勾选时,报表打开自动按缺省条件刷新数据,但会耗费系统资源[建议不勾选]" boolean visible = false integer x = 1317 integer y = 104 integer width = 521 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "报表打开自动刷新" boolean checked = true end type event clicked;Long ll_loginretr IF THIS.Checked THEN ll_loginretr = 1 ELSE ll_loginretr = 0 END IF f_SetProfileString(sys_empid,DW_1.DataObject, "LOGIN_RETRIEVE", String(ll_loginretr)) end event event constructor;THIS.BackColor = 14215660 Int ll_loginretr ll_loginretr = Integer(f_ProfileString(sys_empid,DW_1.DataObject, "LOGIN_RETRIEVE", "1")) IF ll_loginretr = 1 THEN THIS.Checked = TRUE ELSE THIS.Checked = FALSE END IF end event type pb_em1 from picturebutton within w_rp_tj integer x = 635 integer y = 192 integer width = 101 integer height = 92 integer taborder = 120 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string picturename = "date.BMP" alignment htextalign = left! end type event clicked;em_1.triggerevent(rbuttondown!) end event type pb_em2 from picturebutton within w_rp_tj integer x = 1248 integer y = 192 integer width = 101 integer height = 92 integer taborder = 110 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string picturename = "date.BMP" alignment htextalign = left! end type event clicked;em_2.triggerevent(rbuttondown!) end event type pb_2 from picturebutton within w_rp_tj integer x = 1358 integer y = 192 integer width = 101 integer height = 92 integer taborder = 120 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string picturename = "date1.BMP" alignment htextalign = left! end type event clicked;m_Dfc_Control_PopupMenu dmPopupMenu string menustr menustr="Text=本日~tEvent=ue_date1" menustr = menustr + "|" + "Text=本周~tEvent=ue_date2" menustr = menustr + "|" + "Text=本月~tEvent=ue_date3" menustr = menustr + "|" + "Text=上月~tEvent=ue_date4" if len(trim(menustr))<>0 then dmPopupMenu = Create m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(This, menustr) dmPopupMenu.mf_PopMenu() Destroy dmPopupMenu end if end event type cb_delete from uo_imflatbutton within w_rp_tj integer x = 1061 integer width = 384 integer height = 164 integer taborder = 20 boolean bringtotop = true string text = "删除历史报表" string normalpicname = "delete.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;Long ll_row, ll_i,ll_billid String arg_msg,ls_name FOR ll_i = dw_3.RowCount() To 1 Step -1 IF dw_3.IsSelected(ll_i) THEN ll_row = ll_i END IF NEXT IF ll_row <= 0 THEN RETURN ls_name=dw_3.Object.billname[ll_row] IF MessageBox ("询问","是否确定要删除当前选择行吗,报表名称:" + ls_name,Question!,YesNo! ) = 2 THEN RETURN ll_billid = dw_3.Object.billid[ll_row] IF ll_billid <= 0 THEN RETURN IF uo_this_rp.f_delete(ll_billid,arg_msg) = 1 THEN MessageBox('成功','删除成功' ) dw_3.deleterow(ll_row) ELSE MessageBox('错误',arg_msg) return END IF end event type cb_copyself from uo_imflatbutton within w_rp_tj integer x = 347 integer width = 256 integer height = 164 integer taborder = 30 boolean bringtotop = true string text = "打开副本" string normalpicname = "COPY.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;window lw_win s_edit_index_tran s_rpinfo s_rpinfo.if_sendout = if_power_sendout s_rpinfo.if_print = if_power_print OpenWithParm(lw_win,s_rpinfo,PARENT.ClassName()) lw_win.WindowState = Normal! end event type cb_save from uo_imflatbutton within w_rp_tj integer x = 603 integer width = 256 integer height = 164 integer taborder = 40 boolean bringtotop = true boolean enabled = false string text = "保存" string normalpicname = "save.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;Long i,ll_row,ll_row1,ll_row2,old_cusid String arg_msg,ls_rpname IF dw_1.RowCount() < 10 THEN RETURN IF tab_1.SelectedTab=1 and rp_billid<>0 THEN dw_2.selectrow(0,false) dw_3.selectrow(0,false) RETURN end if IF tab_1.SelectedTab=2 and rp_rpid<>0 THEN dw_2.selectrow(0,false) dw_3.selectrow(0,false) RETURN end if if dw_edit_mode=true then dw_1.AcceptText() dw_3.AcceptText() uo_this_rp.billid = rp_billid uo_this_rp.rpid = rp_rpid IF rp_billid = 0 THEN ls_rpname = dw_1.Object.Title.Text OpenWithParm(w_rp_name, ls_rpname) IF Message.StringParm = 'cancel' THEN MessageBox("提示","用户取消操作") RETURN END IF uo_this_rp.billname = Message.StringParm ELSE uo_this_rp.billname = dw_3.Object.billname[ll_dw3_row] END IF IF rp_billid = 0 THEN uo_this_rp.sdate = DateTime(Date(em_1.Text),Time(0)) uo_this_rp.edate = DateTime(Date(em_2.Text),Time(0)) ELSE uo_this_rp.sdate = dw_3.Object.sdate[ll_dw3_row] uo_this_rp.edate = dw_3.Object.edate[ll_dw3_row] END IF IF uo_this_rp.sdate > uo_this_rp.edate THEN MessageBox("错误","开始日期大于结束日期") RETURN END IF if isnull(uo_this_rp.sdate ) or isnull(uo_this_rp.edate ) then MessageBox("错误","开始日期或结束日期设置不正确") RETURN end if //////// //dw_1 IF dw_1.RowCount() > 0 THEN FOR i = 1 To dw_1.RowCount() IF uo_this_rp.acceptmx(& i,& dw_1.Object.colname_l[i],& dw_1.Object.amt_l1[i],& dw_1.Object.amt_l2[i],& dw_1.Object.colname_r[i],& dw_1.Object.amt_r1[i],& dw_1.Object.amt_r2[i],& arg_msg ) = 0 THEN //i 为printid MessageBox('Error!',arg_msg) RETURN END IF NEXT END IF IF uo_this_rp.Save(arg_msg) = 0 THEN MessageBox('Error!',arg_msg) RETURN END IF MessageBox(publ_operator,'保存操作成功!') end if dw_edit_mode= not dw_edit_mode if rp_rpid<>0 then dw_3.retrieve(rp_rpid) end if wf_lock_child() end event type cb_3 from uo_imflatbutton within w_rp_tj integer x = 864 integer width = 192 integer height = 164 integer taborder = 200 boolean bringtotop = true string text = "修改&E" string normalpicname = "open.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF tab_1.SelectedTab=1 and rp_billid<>0 THEN dw_2.selectrow(0,false) dw_3.selectrow(0,false) RETURN end if IF tab_1.SelectedTab=2 and rp_rpid<>0 THEN dw_2.selectrow(0,false) dw_3.selectrow(0,false) RETURN end if dw_edit_mode= not dw_edit_mode wf_lock_child() end event type tab_1 from tab within w_rp_tj integer x = 5 integer y = 324 integer width = 1248 integer height = 1940 integer taborder = 90 boolean bringtotop = true integer textsize = -9 integer weight = 700 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long backcolor = 134217739 boolean raggedright = true boolean focusonbuttondown = true integer selectedtab = 1 tabpage_1 tabpage_1 tabpage_2 tabpage_2 end type on tab_1.create this.tabpage_1=create tabpage_1 this.tabpage_2=create tabpage_2 this.Control[]={this.tabpage_1,& this.tabpage_2} end on on tab_1.destroy destroy(this.tabpage_1) destroy(this.tabpage_2) end on type tabpage_1 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 1211 integer height = 1828 long backcolor = 134217739 string text = "即时报表" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_2 dw_2 end type on tabpage_1.create this.dw_2=create dw_2 this.Control[]={this.dw_2} end on on tabpage_1.destroy destroy(this.dw_2) end on type dw_2 from u_dw_rbtnfilter within tabpage_1 integer x = 14 integer y = 12 integer width = 1198 integer height = 1812 integer taborder = 40 boolean bringtotop = true string dataobject = "dw_rpdef" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event clicked;call super::clicked;IF row <= 0 THEN RETURN This.SelectRow(0,False) This.SelectRow(row,True) rp_dw_row=row f_bulid_rp(rp_dw_row) rp_billid=0 dw_3.retrieve(rp_rpid) Int LS_INT //FOR LS_INT = 1 To 20 // dw_1.SetTabOrder (LS_INT,0 ) //NEXT end event type tabpage_2 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 1211 integer height = 1828 long backcolor = 134217739 string text = "历史报表" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_3 dw_3 end type on tabpage_2.create this.dw_3=create dw_3 this.Control[]={this.dw_3} end on on tabpage_2.destroy destroy(this.dw_3) end on type dw_3 from u_dw_rbtnfilter within tabpage_2 integer y = 12 integer width = 1211 integer height = 1812 integer taborder = 50 boolean bringtotop = true string dataobject = "dw_sp_rp" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event clicked;call super::clicked;IF row <= 0 THEN RETURN This.SelectRow(0,False) This.SelectRow(row,True) ll_dw3_row=row rp_billid=long(dw_3.object.billid[row]) rp_rpid=0 f_bulid_rp_history(rp_billid) //FOR LS_INT = 1 To 20 // dw_1.SetTabOrder (LS_INT,0 ) //NEXT end event type gb_1 from groupbox within w_rp_tj boolean visible = false integer x = 357 integer y = 524 integer width = 1125 integer height = 148 integer taborder = 80 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 15793151 end type type ln_bar from line within w_rp_tj long linecolor = 268435456 integer linethickness = 4 integer beginy = 172 integer endx = 2007 integer endy = 172 end type type ln_bar2 from line within w_rp_tj long linecolor = 16777215 integer linethickness = 4 integer beginy = 176 integer endx = 2039 integer endy = 176 end type type r_bar from rectangle within w_rp_tj long linecolor = 16777215 integer linethickness = 4 long fillcolor = 1073741824 integer x = 2382 integer width = 146 integer height = 68 end type event constructor;this.fillcolor = 14215660 this.linecolor = 14215660 this.x = -1 this.y = -1 this.height = ln_bar.beginy - 5 end event type ln_1 from line within w_rp_tj long linecolor = 268435456 integer linethickness = 4 integer beginy = 292 integer endx = 2016 integer endy = 292 end type type ln_2 from line within w_rp_tj long linecolor = 16777215 integer linethickness = 4 integer beginy = 296 integer endx = 2048 integer endy = 296 end type type ln_3 from line within w_rp_tj long linecolor = 268435456 integer linethickness = 4 integer beginy = 404 integer endx = 2016 integer endy = 404 end type type ln_4 from line within w_rp_tj long linecolor = 16777215 integer linethickness = 4 integer beginy = 408 integer endx = 2048 integer endy = 408 end type