Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - how find row?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how find row?

 Post Reply Post Reply
Author
Message
mozaheb View Drop Down
Senior Member
Senior Member


Joined: 03 April 2008
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote mozaheb Quote  Post ReplyReply Direct Link To This Post Topic: how find row?
    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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
mozaheb View Drop Down
Senior Member
Senior Member


Joined: 03 April 2008
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote mozaheb Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
mozaheb View Drop Down
Senior Member
Senior Member


Joined: 03 April 2008
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote mozaheb Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
mozaheb View Drop Down
Senior Member
Senior Member


Joined: 03 April 2008
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote mozaheb Quote  Post ReplyReply Direct Link To This Post Posted: 23 June 2008 at 4:23am
yes yes, please guide me, thank you
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
mozaheb View Drop Down
Senior Member
Senior Member


Joined: 03 April 2008
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote mozaheb Quote  Post ReplyReply Direct Link To This Post 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.


Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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:
 
 
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....
Back to Top
mozaheb View Drop Down
Senior Member
Senior Member


Joined: 03 April 2008
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote mozaheb Quote  Post ReplyReply Direct Link To This Post Posted: 23 June 2008 at 5:42am
hi again, thank you

but

i dont use virtual mode...

please guide me
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
mozaheb View Drop Down
Senior Member
Senior Member


Joined: 03 April 2008
Status: Offline
Points: 104
Post Options Post Options   Thanks (0) Thanks(0)   Quote mozaheb Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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
 
 
 
 
 
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....
Back to Top
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.