Print Page | Close Window

SOLVED: Locate a row

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=8441
Printed Date: 20 September 2024 at 5:00am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED: Locate a row
Posted By: ElvisM
Subject: SOLVED: Locate a row
Date 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



Replies:
Posted By: sserge
Date Posted: 16 October 2007 at 5:19pm
Some thing like this should help:

For Each Row In wndReportControl.Rows
    For Each RecordItem In Row.Record
        If RecordItem.Value = "..." Then
...


Also search forum, there were already similar questions.

--
WBR,
Serge


Posted By: ElvisM
Date Posted: 16 October 2007 at 7:21pm
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


Posted By: sserge
Date Posted: 17 October 2007 at 6:10pm
No.


Posted By: JKDev
Date Posted: 26 October 2007 at 5:30pm
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)


Posted By: johnlewe
Date Posted: 29 October 2007 at 9:22am
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


Posted By: JKDev
Date Posted: 29 October 2007 at 6:05pm

yup, the more i use it the more i see thus as an absolute must have...




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net