I have a menu item that when clicked, it will filter the datawindow (using a hard-coded value at this point). If the menu item is clicked again, the filter will be cleared.
The problem is, when the menu item is clicked again (to once again filter the data), the rows are now in a different order (can't seem to find any logical mapping - sorting is still by the correct column (not unique), but within each sorted set, the order of the rows is different). I don't know if this matters, but I am filtering by the same column as the sort column.
I don't want the order of the rows to change if this filter is clicked again.
Please help! Here is my code: (Note:str_userName is passed into the Function, an empty string would represent a wish to "clear" the filter)
string str_criteria
if str_userName <> "" then
str_criteria = "rep = '" + str_userName + "'"
else
str_criteria = ""
end if
dw_file_viewer.setfilter (str_criteria)
dw_file_viewer.filter( )
return
The problem is, when the menu item is clicked again (to once again filter the data), the rows are now in a different order (can't seem to find any logical mapping - sorting is still by the correct column (not unique), but within each sorted set, the order of the rows is different). I don't know if this matters, but I am filtering by the same column as the sort column.
I don't want the order of the rows to change if this filter is clicked again.
Please help! Here is my code: (Note:str_userName is passed into the Function, an empty string would represent a wish to "clear" the filter)
string str_criteria
if str_userName <> "" then
str_criteria = "rep = '" + str_userName + "'"
else
str_criteria = ""
end if
dw_file_viewer.setfilter (str_criteria)
dw_file_viewer.filter( )
return