2007-09-07

Access data values from composite datawindow

We may need to access certain values at run-time. To access values in the normal datawindow object, we use the following dot notation syntax:

datawindowControl.Object.columnname[row]


In order to access nested object values of composite datawindow, we can use:

datawindowControl.Object.Reportname.Object.value[row]


Sometimes, we need to modify nested report object properties. we may use Getchild() function to get nested report handle, and then manipulate it as if the neasted report is a datawindow control. Here is an example:


//There is a composite datawindow control named dw_product_info
//A composite datawindow has dw_master and dw_detail neasted report.
//We need to sort the rows of dw_detail by the first column

datawindowchild ldwc_detail
dw_product_info.getchild("dw_detail",ldwc_detail)
ldwc_detail.setsort("#1 A")
ldwc_detail.sort()

No comments: