方法是:
DWObject ldwo_use,ldwo_name
ldwo_use = dw_1.Object
ldwo_name = ldwo_use.__get_attribute("name",FALSE)
這樣就可以在用setitem()設置值時,手工調用數窗的itemchanged事件,校驗是否接受該值
int li_rtn
li_rtn = dw_1.event itemchanged(dw_1.GetROW(),ldwo_name,'arg1')
if li_rtn = 0 then
dw_1.SetItem(dw_1.GetROW(),'name",'arg1')
end if
非複合報表中的嵌套報表不可使用getchild取得,也不可使用describe取得屬性和使用modify更改屬性,
你可以調用PB未載入文檔的函數來獲取/更改屬性,請看示例,注意多層嵌套時使用循環獲取最終對象.
例:數據窗口控件dw_test包含嵌套報表dw_1,dw_1有欄位dept_name.
dwobject ldwo_parent,ldwo_obj
string ls_color
ldwo_parent = dw_1.o b j e c t
ldwo_obj = ldwo_parent.__get_attribute("dw_1",false)
ldwo_obj = ldwo_obj.o b j e c t
ldwo_obj = ldwo_obj.__get_attribute("dept_name",false)
ls_color = ldwo_obj.color//取顏色
ldwo_obj.__set_attribute("color",rgb(192,192,192))//更改顏色
__get_attribute()、__get_attribute_item()、__invoke_method()、__set_attribute()、__set_attribute_item()