Solved

remember the sort criteria of a datawindow

Posted on 2004-03-23
6
303 Views
Last Modified: 2013-12-26
Hi!

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

Thank you!
0
Comment
Question by:tsirakua
6 Comments
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 125 total points
ID: 10664520
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
 
LVL 18

Expert Comment

by:diasroshan
ID: 10664616
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
 
LVL 18

Expert Comment

by:diasroshan
ID: 10664626
...oops ...a bit late....

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

Cheers,,
Rosh
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:sandeep_patel
ID: 10664667
Hi! Rosh,

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

-sandeep
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10666986
Hey this EE should have something like "Row (Page) changed between retrieve and update" :))
--Vikas
0
 

Author Comment

by:tsirakua
ID: 10669943
Thank you
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Studio 2013 5 85
selectallvieditor 6 124
Best free Visio Editor? 2 233
Syntax Error 2 93
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deletiā€¦
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question