Print Page | Close Window

how find 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=11144
Printed Date: 02 July 2025 at 8:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how find row?
Posted By: mozaheb
Subject: how find row?
Date Posted: 22 June 2008 at 12:28pm
hi

1-how find row in report control when add new record and setfocuse on row?
2-how find row with tag?

please reply

thank you



Replies:
Posted By: Aaron
Date Posted: 22 June 2008 at 2:04pm
Hi,
 
Please upload sample project and add comment what and where you want it  
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: mozaheb
Date Posted: 23 June 2008 at 1:45am
when add new record in report control, i want setfocuse on newer record
or
when search tag and find and setfocuse on record


Posted By: Aaron
Date Posted: 23 June 2008 at 3:55am
Hi,
 
That's why I wanted you to upload a sample... The first question I can answer but the second I really don't know what you mean.
 
Private Sub AddRecord()
    Dim XtremeRecord As XtremeReportControl.ReportRecord
    Dim XtremeRecordItem As XtremeReportControl.ReportRecordItem
 
    Set XtremeRecord = wndReportControl.Records.Add()
        Set XtremeRecordItem = XtremeRecord.AddItem("test")
            
    wndReportControl.Populate
    
    'Focus added record    
  1.     wndReportControl.Rows.FindRow(XtremeRecord).Selected = True
  2.     wndReportControl.Rows(XtremeRecord.Index).Selected = True
  3. wndReportControl.Navigator.MoveToRow wndReportControl.Rows.FindRow(XtremeRecord).Index, False, False

End Sub

 
Note: I would expect that the row (with option 3) is focused and selected but it isn't (look in the help!!!)  Maybe a support member can explain why 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: mozaheb
Date Posted: 23 June 2008 at 4:06am
thank you for answer my question #1

now, please guide me for how find record by tag?

example : in my report control added 1000 record and i want find record with tag and setfouse on record.


Posted By: Aaron
Date Posted: 23 June 2008 at 4:11am
Hi,
 
You assigned a value to a tag? And you want to find the value (tag) in all records?
 
May I ask why you want to this?
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: mozaheb
Date Posted: 23 June 2008 at 4:23am
yes yes, please guide me, thank you


Posted By: Aaron
Date Posted: 23 June 2008 at 4:43am
Hi,
 
I have been experimenting a lot with the ReportControl but I never needed to use the .Tag before. That's why I asked you: Why do you need this anyway? Maybe I can help you and don't have to use the .Tag property at all
 
Here's a function to iterate the RC records
 
Private Function FindTag(strTag As String)
    Dim record As XtremeReportControl.ReportRecord
   
    For Each record In wndReportControl.Records
        If record.Tag = strTag Then MsgBox "Record found... Index = " & record.Index
    Next record
   
End Function
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: mozaheb
Date Posted: 23 June 2008 at 4:52am
i want use tag for set Record ID and when update database update Record id, for this problem use tag to find record id and update items of record.




Posted By: Aaron
Date Posted: 23 June 2008 at 5:33am
Hi,
 
Ok,
 
There are other ways of doing this but than I have to know how you load the database records and how your table looks.
 
Maybe you could check this post:
 
http://forum.codejock.com/forum_posts.asp?TID=10814 - http://forum.codejock.com/forum_posts.asp?TID=10814
 
and look for sample:
 
uploads/20080602_072905_ReportVirtualDa.zip
 
 
This will load a recordset into a RC in virtual list mode and you can edit items and will be immediately updated in database.
 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: mozaheb
Date Posted: 23 June 2008 at 5:42am
hi again, thank you

but

i dont use virtual mode...

please guide me


Posted By: Aaron
Date Posted: 23 June 2008 at 7:27am
Hi,
 
Virtual mode is like you would open your table (in my case MS Access). The recordset is loaded into ReportControl using the BeforeDrawRow event
 
first row will be the first row in ReportControl
second row will be the second row in ReportControl and so on
 
If you load the recordset of database as records you will have the same as with virtual records (my sample)
 
Show me how you load the records from the database? I want to help you but I don't know: what database you use? how you load records? As I said before upload a sample project and I will help you. If you don't want me to see the data in the database make a sample with some dummy data. As long the columns are the same as yours so it isn't to difficult to change it for your needs.
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: mozaheb
Date Posted: 23 June 2008 at 7:47am
hi

example , i want add this option for user to select checkmark for show number o same name for each contact if find name in database...

now if found number replace number with contact name, and i want replace record in RC in a few second.

my data base : access (MDB)


example source :

Sub Refresh_Inbox()
    Dim DataInbox As ClsDataBase

    Set DataInbox = New ClsDataBase

    LstInbox.Records.DeleteAll
    LstInbox.Populate

    Call DataInbox.Get_AllRecivedSMS(SMSReciveRecords, PCon)


    While Not ContactsRecords.EOF

        Call AddRecordList(ContactsRecords!ID, ContactsRecords!Active, ContactsRecords!Name, ContactsRecords!MobileNum, ContactsRecords!GroupName, ContactsRecords!Field1, ContactsRecords!Field2, ContactsRecords!Field3, ContactsRecords!Field4, ContactsRecords!LastSend, ContactsRecords!SmsCount)

        ContactsRecords.MoveNext

    Wend

    'Updates the Report
    LstInbox.Populate
    LstInbox.FocusSubItems = False


End Sub

thank you


Posted By: Aaron
Date Posted: 23 June 2008 at 8:51am
Hi,
 
Here's s test project. Copy your database in the same directory as the project and change the database and table name in the form load event. Data will be loaded and you can change the items as you wish and are updated in the database!!! So don't use your original database
 
 
 
https://forum.codejock.com/uploads/20080623_085013_TestReportContr.zip - uploads/20080623_085013_TestReportContr.zip
 
 
Good luck !
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Baldur
Date Posted: 10 July 2008 at 7:52am
It's very simple:
 
dim xReportRow as ReportRow
dim xMyTag as variant
 
for each xReportRow in ReportControl.rows
  if xReportRow.Record.Tag = xMytag then
     ReportControl.FocusedRow = xReportRow
     exit for
  end if
next
 
The same can do with each property.



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