![]() |
SOLVED: Locate a row |
Post Reply ![]() |
Author | |
ElvisM ![]() Senior Member ![]() ![]() Joined: 12 October 2006 Location: Venezuela Status: Offline Points: 129 |
![]() ![]() ![]() ![]() ![]() Posted: 16 October 2007 at 3:22pm |
Hi, there is a way to locate a row in the reporcontrol by a column value without iterate all the rows of it?
Excuseme my english, is so bad.
Elvis
|
|
Product: Xtreme SuitePro (ActiveX) version 17.2
Platform: Windows 10 64bits Language: Visual Basic 2015 |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
Some thing like this should help:
Also search forum, there were already similar questions. -- WBR, Serge |
|
![]() |
|
ElvisM ![]() Senior Member ![]() ![]() Joined: 12 October 2006 Location: Venezuela Status: Offline Points: 129 |
![]() ![]() ![]() ![]() ![]() |
I said a way that I do not to iterate all the rows to find the row. There is not a method that I can find the desired row only by a column value? (without iterate all the reportcontrol's records)
PD: Excuseme my english
|
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
No.
|
|
![]() |
|
JKDev ![]() Groupie ![]() Joined: 27 September 2007 Location: Ireland Status: Offline Points: 59 |
![]() ![]() ![]() ![]() ![]() |
Hmm, it would be great if you could provide a function to quickly search all of the records .tag property for a match. such as
Report.Records.FindTag "172" etc.
It is essential to be able to locate the record that is associated with a particular database row based on a primary key.
Iterating through all of the records as suggested is time consuming. Perhaps you could add a .Key property for the Record similar to a ListView.ListItem.Key? That way we could retrieve the correct row with code like this
msgID = "M" + ltrim$(str$(rs("msgID")))
set rec = Report.Records.Item(msgID)
|
|
![]() |
|
johnlewe ![]() Newbie ![]() ![]() Joined: 26 October 2007 Location: United States Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
I agree. Looping through EVERY row is just not practical. The record object needs a key property. Likewise the column object needs a key. Every time I need to refer to a RecordItem, I need to remember the numerical index value of the column. In the ListView control you can refer to the RecordItem using the NAME/KEY of the column. It makes the code ALOT more readable and easy to maintain. What I have done to workaround this limitation is to store the name of the column in the .tag property of the column and then I have to call a function that loops through every column in the control until it finds that tag and then returns the numerical index of the column.
Is there a specific reason by design why the ReportControl does not have "key" objects? Or is this coming in a future revision? We replaced our listview control with the Codejock ReportControl to get past the limitations of the listview control, but in this case, those limitations are being replaced with Codejock ReportControl limitations which the listview control did not have. Make us all very happy and add this basic feature that the listview control has...please... |
|
John Lewe
Orlando, FL |
|
![]() |
|
JKDev ![]() Groupie ![]() Joined: 27 September 2007 Location: Ireland Status: Offline Points: 59 |
![]() ![]() ![]() ![]() ![]() |
yup, the more i use it the more i see thus as an absolute must have... |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |