Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

remember the sort criteria of a datawindow

Hi!

How to save the current sort criteria of a datawindow to aply another and later return to the first sort?

Thank you!
0
tsirakua
Asked:
tsirakua
1 Solution
 
sandeep_patelCommented:
hi,
let's take an example that your datawindow has two columns emp_code and emp_name and you specified the sort criteria while designing the datawindow so your sort criteria is say
'emp_name A'.
now through script u can get this value by using

String is_sort  // instance variable
is_sort = dw_1.Object.datawindow.table.sort

you can store this value in instance variable, before applying another sort scriteria and can reapply later with
dw_1.setsort(is_sort) and
dw_1.sort()

hope it will work for u..if not reply...
-sandeep
0
 
diasroshanCommented:
hi  tsirakua,
try the following code in the clicked event of a button...assuming that ur dw has retrieved....

String ls_sort, ls_caption

ls_caption = cb_sort.Text
If Upper(ls_caption) = 'SORT' Then
      is_oldsort = dw_1.Object.DataWindow.Table.Sort  // remember old sort criteria
      SetNull(ls_sort )
      dw_1.SetSort(ls_sort)   // ask user for sort criteria
      dw_1.Sort()
      cb_sort.Text = 'Release'
Elseif Upper(ls_caption) = 'RELEASE' Then
      dw_1.SetSort(is_oldsort)  // apply old sort criteria
      dw_1.Sort()
      cb_sort.Text = 'Sort'
End If      

let me know for further clarifications......

Cheers...
Rosh
0
 
diasroshanCommented:
...oops ...a bit late....

...anyways just forgot to mention is_oldsort is an instance variable...

Cheers,,
Rosh
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
sandeep_patelCommented:
Hi! Rosh,

don't worry man...better luck for next time..and still it's not closed....it's open........:)

-sandeep
0
 
Vikas_DixitCommented:
Hey this EE should have something like "Row (Page) changed between retrieve and update" :))
--Vikas
0
 
tsirakuaAuthor Commented:
Thank you
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now