PB获取数据窗口字段列名和标题名

int li_value
long ll_i,ll_rowcount
string ls_usrid,ls_tooltip
decimal ldc_lastvalue
ll_rowcount = dw_1.rowcount( )
if ll_rowcount <= 0 then return

SetPointer(HourGlass!)
Open(w_sys_tip)
w_sys_tip.st_info.text = '系统正在比对上月数据,请耐心等候...'
w_sys_tip.hpb_bar.MaxPosition = ll_rowcount + 1

Int   li_cnt,li_Count
String  ls_ColName
Decimal ldc_Data

String ls_col[], ls_value[]

for ll_i = 1 to ll_rowcount
	ls_usrid = dw_1.getitemstring(ll_i,'usr_id')

//gwgz,qjj,wpbt,zfgjj,dkdj,fzf,ghhf,zfbt
li_Count = Integer(dw_1.Describe("datawindow.column.count"))
//messagebox('',string(li_Count))
For li_cnt = 6 To li_Count - 5
	ls_ColName = dw_1.Describe("#"+String(li_cnt)+".name")
//	messagebox('',ls_ColName)
	If ls_ColName <> 'gwgz' AND ls_ColName <> 'qjj' AND ls_ColName <> 'wpbt' AND &
	ls_ColName <> 'zfgjj' AND ls_ColName <> 'dkdj' AND ls_ColName <> 'fzf' AND &
	ls_ColName <> 'ghhf' AND ls_ColName <> 'zfbt' Then Continue
	ldc_Data = Dec(dw_1.Object.Data[ll_i,li_cnt])
//	messagebox('',string(ldc_Data))
//	ld_gwgz = dw_1.getitemnumber(ll_i,'gwgz')
//	messagebox(string(ll_i),ls_usrid+'/'+ls_ColName+'/'+string(ldc_Data))
	li_value = f_gz_compare(ls_usrid,ls_ColName,ldc_Data,ld_date,ldc_lastvalue)
	IF li_value = 1 THEN
		ls_col = {ls_ColName}
		ls_value = {String(ll_i),"rgb(0,250,0)"}
		uf_setcell_color( dw_1, "background", "row", ls_col, ls_value )
//		ls_tooltip = ls_ColName+".tooltip.tip='~tif(getrow()="+String(ll_i)+",~"上月金额:"+String(ldc_lastvalue,'#,##0.00')+"~",~"~")'" 
//		messagebox('',ls_tooltip)
//		dw_1.modify( ls_tooltip )
		String ls_Title
		ls_Title = dw_1.Describe(ls_ColName+"_t.text")
		ls_value = {String(ll_i),"上月"+ls_Title+":"+String(ldc_lastvalue,'#,##0.00')}
		uf_setcell_tooltip( dw_1, ls_col, ls_value )
	END IF
//	messagebox('end',string(li_value))
	
Next
//messagebox('',string(w_sys_tip.hpb_bar.maxPosition))
if w_sys_tip.hpb_bar.Position <= ll_rowcount then
	w_sys_tip.hpb_bar.Position = w_sys_tip.hpb_bar.Position + 1
end if
next
//f_gz_compare('1002','gwgz',1234)
SetPointer(Arrow!)
Close(w_sys_tip)

阅读更多
文章标签: string integer date
个人分类: powerbuilder
上一篇pb中关于转义符'~'的用法
下一篇远程桌面无法连接解决方法
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭