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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to set a rating by date counter in a datawindow

Status
Not open for further replies.

Andyfives

Programmer
Feb 22, 2002
46
0
0
DK
Hi there,

Please help..

I need to build a datawindow that on initilisation sorts data by date. What I need is to set a rating on the oldest to newest and store that number in a column.

The user after this initilisation is able to filter and sort on any other column in the dw. I would like the rating to be maintained.

Can anyone tell me if this is possible without having to store this rating value in the db?

The reason for this is we want the users to be able to pick any record in the db and remove it so we can then reshuffle the rest of the numbers so we have no gaps.

Hopefully I have explained the problem ok... If anyone can help me

Thank you

Andy

 
Hi,

I found the answer to this one.

I set up in the SQL an extra column:
0 as Rating

then on the open event of the window itself I load the row values into the column using setitem().

Code:
for ll_row = 1 to dw_list.rowcount()
	dw_list.setitem(ll_row,"rating",dw_list.GetRowFromRowId(ll_row))
next

It needs some tuning, but is good enough for me for a start.

Andy
 
You can simply use ll_row rather than dw_list.GetRowFromRowId(ll_row) in the SetItem, as long as you've sorted/ordered before doing the row loop.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top