Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to sort in datawindow composite

Status
Not open for further replies.

montjoile

Programmer
May 23, 2011
23
CO
hi. I have two datawindow nested in a datawindow compsosite. What I want to do is to sort one of the two datawindows by a user criteria. I dont know how to do it, but it might be meaningful saying that the datawindow that I want to sort have two different tables.

I have tried this code:
datawindowchild dwc_sort
dw_1.getchild("dw_2", dwc_sort)
dwc_sort.setsort("gsi_cate_sistemas.seg_sist_codigo=1"+ ls_sist_code)
dwc_sort.sort()

 
It does not matter the number of tables. You can even sort on computed columns. The format is <column name> <asc/desc>. For instance:

DataWindowChild ldwc

dw_1.GetChild( 'dw_child', ldwc )
ldwc.SetSort( 'column_1 asc, column_2 desc' )
ldwc.Sort( )

What the above code will do is sort the nested DataWindow by the column called "column_1" in ascending order first and then the column called "column_2" in descending order.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top