$PBExportHeader$w_rp_money_xs_fy.srw forward global type w_rp_money_xs_fy from w_publ_easyq end type end forward global type w_rp_money_xs_fy from w_publ_easyq string title = "分部核算表" end type global w_rp_money_xs_fy w_rp_money_xs_fy type variables long cur_itemid[] string cur_columnname[] long cur_itemcnt end variables forward prototypes public subroutine wf_retr_item () public subroutine wf_retr_itemmx () end prototypes public subroutine wf_retr_item ();String ls_item = '' Long ls_costsid Int i = 1 Int li_itemcnt = 40 dw_1.SetRedraw(FALSE) datastore ds ds = CREATE datastore ds.DataObject = "ds_itemdef" ds.SetTransObject(sqlca) cur_itemcnt = ds.Retrieve() if cur_itemcnt > li_itemcnt then messagebox("系统提示","目前报表只支持最多"+string(li_itemcnt)+"个项目") cur_itemcnt = li_itemcnt end if DO WHILE i <= li_itemcnt dw_1.Modify("item"+String(i)+"_t.visible=true") dw_1.Modify("item"+String(i)+".visible=true") i++ LOOP FOR i = 1 TO cur_itemcnt cur_itemid[i] = ds.Object.itemid[i] ls_item = ds.Object.itemname[i] cur_columnname[i] = "item"+String(i) dw_1.Modify("item"+String(i)+"_t.Text='"+ls_item+"'") NEXT DO WHILE i <= li_itemcnt dw_1.Modify("item"+String(i)+"_t.visible=false") dw_1.Modify("item"+String(i)+".visible=false") i++ LOOP //wf_retr_itemmx() dw_1.SetRedraw(TRUE) end subroutine public subroutine wf_retr_itemmx ();Long i,j,rslt = 1 Long ls_rowcount Long ll_itemid,ll_scid Decimal ld_temp_amt DateTime firstdate,enddate firstdate = DateTime(Date(em_1.Text),Time(0)) enddate = DateTime(Date(em_2.Text),Time('23:59:59')) ls_rowcount = dw_1.RowCount() Open(w_sys_wait_jdt) w_sys_wait_jdt.wf_accepttol(ls_rowcount) FOR i = 1 TO ls_rowcount w_sys_wait_jdt.wf_inc(i) w_sys_wait_jdt.wf_set_msg('正在处理中....') ll_scid = dw_1.Object.scid[i] FOR j = 1 TO cur_itemcnt ll_itemid = cur_itemid[j] SELECT sum(u_income_expenses.amt * u_itemdef.itemflag) INTO :ld_temp_amt FROM u_income_expenses inner join u_income_expenses_mx on u_income_expenses_mx.billid=u_income_expenses.billid INNER JOIN u_itemdef ON u_income_expenses_mx.itemid = u_itemdef.itemid WHERE (u_income_expenses.flag = 1) AND (u_income_expenses.scid = :ll_scid) AND (u_itemdef.itemid = :ll_itemid) and u_income_expenses.outdate >= :firstdate and u_income_expenses.outdate <= :enddate; IF SQLCA.SQLCode <> 0 THEN ld_temp_amt = 0 END IF //(u_income_expenses.secflag = 1) AND IF IsNull(ld_temp_amt) THEN ld_temp_amt = 0 dw_1.SetItem(i,"item"+String(j),ld_temp_amt) NEXT NEXT Close(w_sys_wait_jdt) dw_1.AcceptText() end subroutine on w_rp_money_xs_fy.create call super::create end on on w_rp_money_xs_fy.destroy call super::destroy end on event open;call super::open;wf_retr_item() IF cbx_loginretr.Checked THEN cb_1.TriggerEvent(Clicked!) END IF end event type cb_func from w_publ_easyq`cb_func within w_rp_money_xs_fy end type type cb_exit from w_publ_easyq`cb_exit within w_rp_money_xs_fy end type type cb_2 from w_publ_easyq`cb_2 within w_rp_money_xs_fy end type type cb_psetup from w_publ_easyq`cb_psetup within w_rp_money_xs_fy end type type cb_1 from w_publ_easyq`cb_1 within w_rp_money_xs_fy end type event cb_1::clicked;DateTime firstdate,enddate firstdate = DateTime(Date(em_1.Text),Time(0)) enddate = DateTime(Date(em_2.Text),Time('23:59:59')) DELETE FROM u_parm_pay Where id = 2 ; IF sqlca.SQLCode <> 0 THEN MessageBox('错误','数据库操作失败!'+sqlca.SQLErrText,stopsign!,ok!) ROLLBACK; RETURN END IF INSERT INTO u_parm_pay (firstdate,enddate,id) Values (:firstdate,:enddate,2); IF sqlca.SQLCode <> 0 THEN MessageBox('错误','数据库操作失败!'+sqlca.SQLErrText,stopsign!,ok!) ROLLBACK; RETURN END IF COMMIT; dw_1.Retrieve(firstdate,enddate) wf_retr_itemmx() //dw_1.Object.dt_ar.Text = "日期范围: "+String(Date(firstdate))+" 到 "+em_2.Text end event type st_3 from w_publ_easyq`st_3 within w_rp_money_xs_fy end type type st_4 from w_publ_easyq`st_4 within w_rp_money_xs_fy end type type em_1 from w_publ_easyq`em_1 within w_rp_money_xs_fy end type type em_2 from w_publ_easyq`em_2 within w_rp_money_xs_fy end type type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_money_xs_fy end type type cbx_yl from w_publ_easyq`cbx_yl within w_rp_money_xs_fy end type type dw_1 from w_publ_easyq`dw_1 within w_rp_money_xs_fy integer y = 304 string dataobject = "dw_rp_money_xs_fy" end type type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_money_xs_fy end type type sle_cust from w_publ_easyq`sle_cust within w_rp_money_xs_fy end type type st_mtrl from w_publ_easyq`st_mtrl within w_rp_money_xs_fy end type type st_cust from w_publ_easyq`st_cust within w_rp_money_xs_fy end type type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_money_xs_fy boolean visible = true end type type pb_em1 from w_publ_easyq`pb_em1 within w_rp_money_xs_fy end type type pb_em2 from w_publ_easyq`pb_em2 within w_rp_money_xs_fy end type type pb_2 from w_publ_easyq`pb_2 within w_rp_money_xs_fy end type type cb_help from w_publ_easyq`cb_help within w_rp_money_xs_fy end type type cb_copyself from w_publ_easyq`cb_copyself within w_rp_money_xs_fy end type type gb_1 from w_publ_easyq`gb_1 within w_rp_money_xs_fy end type type ln_bar from w_publ_easyq`ln_bar within w_rp_money_xs_fy end type type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_money_xs_fy end type type r_bar from w_publ_easyq`r_bar within w_rp_money_xs_fy end type type ln_1 from w_publ_easyq`ln_1 within w_rp_money_xs_fy end type type ln_2 from w_publ_easyq`ln_2 within w_rp_money_xs_fy end type type ln_3 from w_publ_easyq`ln_3 within w_rp_money_xs_fy boolean visible = false end type type ln_4 from w_publ_easyq`ln_4 within w_rp_money_xs_fy boolean visible = false end type