下現兩段程式:
第一段是由程序產生的組成的報表。
第二段是上面查詢條件對各個欄位的要求。
dw_1.settransobject(gtr_qry)
this.x=0
this.y=0
ii_right = ycr_user.uf_getright('KHTS_ZRHF')
choose case ii_right
case 0
messagebox("提示","你沒有權限使用這個功能,請與系統管理員聯系!",stopsign!,ok!)
close(this)
return
case 1
cb_exp.enabled=false
case 2
cb_exp.enabled=false
case 3
cb_exp.enabled=true
end choose
string ls_parm
lstruc_colname.struc_colname[1]="公司"
lstruc_colname.struc_colname[2]="公司承擔總金額"
lstruc_colname.struc_colname[3]="直接責任人承擔總金額"
lstruc_colname.struc_colname[4]="直接領導承擔總金額"
lstruc_colname.struc_colname[5]="間接領導承擔總金額"
lstruc_colname.struc_colname[6]="理賠報告數"
lstruc_colname.struc_colname[7]="受理時間"
integer rtncode1
rtncode1 = dw_2.GetChild('name1',colname_child)
IF rtncode1 = -1 THEN
MessageBox("Error", "Not a DataWindowChild")
return
end if
dw_2.Modify("name1.DDDW.PercentWidth=140")
long ll_rowcount
long ll_currentrow
long ll_struccount
ll_struccount=upperbound(lstruc_colname.struc_colname)
dw_2.insertrow(0)
for ll_rowcount=1 to ll_struccount
ll_currentrow=colname_child.insertrow(0)
colname_child.setitem(ll_currentrow,'colname',lstruc_colname.struc_colname[ll_rowcount])
next
第二段條件對應的。
dw_2.AcceptText()
gf_queryfilterdw_delrow(dw_2)
String ls_filter
ls_filter = ""
Long ll_rowcount
long ll_row
String ls_colnamevalue
Long ll_ii
String ls_value
String ls_czf
String ls_orand
date ldt_begin_time1
date ldt_end_time1
ll_rowcount = dw_2.RowCount()
//If ll_rowcount <= 0 Then
// Return
//End If
ldt_begin_time1 = date(em_begin_time1.text)
ldt_end_time1 = date(em_end_time1.text)
For ll_ii = 1 To ll_rowcount
ls_colnamevalue = dw_2.GetItemString(ll_ii,'name1')
ls_colnamevalue = Trim(ls_colnamevalue)
If IsNull(ls_colnamevalue) Or ls_colnamevalue = "" Then
Continue
End If
ls_czf = dw_2.GetItemString(ll_ii,'bjf')
If IsNull(ls_czf) Or ls_czf = "" Then
Continue
End If
ls_value = dw_2.GetItemString(ll_ii,"name2")
ls_value = Trim(ls_value)
If IsNull(ls_value) Or ls_value = "" Then
Continue
End If
ls_orand = dw_2.GetItemString(ll_ii,'orand')
Choose Case ls_colnamevalue
Case "公司"
ls_filter = ls_filter + "gs_name "+ls_czf+" '"+ls_value+"' "
//ls_filter = ls_filter+"V_LPCHL_ZRHF_TONGJI.gs_name "+ls_czf+" '"+ls_value+"' "
If ll_ii < ll_rowcount Then
ls_filter = ls_filter + ls_orand+" "
End If
Case "公司承擔總金額"
if isnumber(ls_value) then
ls_filter = ls_filter + "hj_gscdje "+ls_czf+" "+ls_value+" "
//ls_filter = ls_filter+"V_LPCHL_ZRHF_TONGJI.hj_gscdje "+ls_czf+" "+ls_value+" "
If ll_ii < ll_rowcount Then
ls_filter = ls_filter + ls_orand+" "
End If
else
MessageBox("提示","金額只能為數字!",stopsign!,ok!)
Return
end if
Case "直接責任人承擔總金額"
if isnumber(ls_value) then
ls_filter = ls_filter + "hj_zzrcdje "+ls_czf+" "+ls_value+" "
//ls_filter = ls_filter+"V_LPCHL_ZRHF_TONGJI.hj_zzrcdje "+ls_czf+" "+ls_value+" "
If ll_ii < ll_rowcount Then
ls_filter = ls_filter + ls_orand+" "
End If
else
MessageBox("提示","金額只能為數字!",stopsign!,ok!)
Return
end if
Case "直接領導承擔總金額"
if isnumber(ls_value) then
ls_filter = ls_filter + "hj_zhjld_cdje "+ls_czf+" "+ls_value+" "
//ls_filter = ls_filter+"V_LPCHL_ZRHF_TONGJI.hj_zhjld_cdje "+ls_czf+" "+ls_value+" "
If ll_ii < ll_rowcount Then
ls_filter = ls_filter + ls_orand+" "
End If
else
MessageBox("提示","金額只能為數字!",stopsign!,ok!)
Return
end if
Case "間接領導承擔總金額"
if isnumber(ls_value) then
ls_filter = ls_filter + "hj_jjld_cdje "+ls_czf+" "+ls_value+" "
//ls_filter = ls_filter+"V_LPCHL_ZRHF_TONGJI.hj_jjld_cdje "+ls_czf+" "+ls_value+" "
If ll_ii < ll_rowcount Then
ls_filter = ls_filter + ls_orand+" "
End If
else
MessageBox("提示","金額只能為數字!",stopsign!,ok!)
Return
end if
Case "理賠報告數"
if isnumber(ls_value) then
ls_filter = ls_filter + "hj_masterid "+ls_czf+" "+ls_value+" "
//ls_filter = ls_filter+"V_LPCHL_ZRHF_TONGJI.hj_masterid "+ls_czf+" "+ls_value+" "
If ll_ii < ll_rowcount Then
ls_filter = ls_filter + ls_orand+" "
End If
else
MessageBox("提示","理賠報告數只能為數字!",stopsign!,ok!)
Return
end if
End Choose
Next
If ls_filter = "" Then
ls_filter = " 1=1 "
// MessageBox("提示","請輸入查詢條件",stopsign!,ok!)
// Return
End If
dw_1.setfilter(ls_filter)
dw_1.filter()
if (not isnull(ldt_begin_time1)) and (not isnull(ldt_end_time1)) then
dw_1.Object.DataWindow.Table.Procedure="1 execute dbo.LPCHL_ZRHF_TONGJI;1 @LastLeaderApproveTimeBegin = '" + string(ldt_begin_time1) + "', @LastLeaderApproveTimeEnd = '" + string(ldt_end_time1) + "'"
else
dw_1.Modify("DataWindow.Table.Procedure='1 execute dbo.LPCHL_ZRHF_TONGJI;1 @LastLeaderApproveTimeBegin = NULL, @LastLeaderApproveTimeEnd = NULL" )
end if
long ll_rows
ll_rows = dw_1.Retrieve()
IF ll_rows < 1 THEN
MessageBox("提示","沒有檢索到資料。")
Return
end if
第二段是第一段查詢條件的陳述句,
現在第一段中加入一個“受理時間”但這個受理時間應該怎么樣來在第二段的程式的查找條件。
請幫忙所要加的陳述句怎么寫。
uj5u.com熱心網友回復:
怎么沒有人回貼uj5u.com熱心網友回復:
代碼很長uj5u.com熱心網友回復:
你想在第二段程式中想干什阿.能不能說明白點.
還有我個人認為你的ls_filter不對.怎么沒有邏輯詞.
if lds_print.retrieve(ls_value[1],ls_value[2])=-1 then//多個引數檢索
disconnect ;
connect ;
return -1
end if
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/106262.html
標籤:腳本語言
上一篇:發票套打的問題
下一篇:jquery中的提交
