Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Detect Records Value
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Detect Records Value

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


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Topic: Detect Records Value
    Posted: 26 September 2007 at 8:41pm
Hi,
I have a reportcontrol, with a number X of rows, and 5 columns. how can I be able to retrieve the value of each column of each row?
thank you.
Please HELP!!!!

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

Joined: 09 June 2006
Status: Offline
Points: 273
Post Options Post Options   Thanks (0) Thanks(0)   Quote joeliner Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2007 at 11:03am
play around with this. works for me fine. :)
 
Dim str As String
Dim RecordItem As ReportRecordItem
    For Each RecordItem In Row.Record
    If wndReportControl.Columns(wndReportControl.Columns.Count - 1).Index = 11 Then
        'check if row or group row
        str = Row.Record.Item(wndReportControl.Columns.Count).value
    End If
    Next
 
regards,
Back to Top
moe188 View Drop Down
Senior Member
Senior Member


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2007 at 2:04pm
no luck,
I tried your code, but it did not do anything at all.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 01 October 2007 at 6:49pm
Just enhance this and iterate everything, like below:

Dim str As String
Dim RecordItem As ReportRecordItem
Dim Row As ReportRow
Dim col As ReportColumn
For Each Row In wndReportControl.Rows
  If Not Row.Record Is Nothing Then
    For Each RecordItem In Row.Record
      str = RecordItem.Value
      Debug.Print str
    Next
  End If
Next


--
WBR,
Serge
Back to Top
moe188 View Drop Down
Senior Member
Senior Member


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2007 at 4:03pm
Hi, Serge
I cant get it to work, any code that I used will return an empty string. so I will appreciate if you can help me solving this problem ASAP
Note: I am tryint to read the content of each column of each row in order to save data into my database... (except if there is another way in doing so).
Thank you
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2007 at 4:20pm
Hi,

Your RecordItem.Value may be not a String, but something else like integer - this could be a reason of incorrect type cast. Try using
Debug.Print RecordItem.Value
without an additional convertation.

--
WBR,
Serge
Back to Top
moe188 View Drop Down
Senior Member
Senior Member


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2007 at 3:10pm
okay, I tried the following code, but I was only able to display the value of record for the first row.
 
code:
    Dim Record As ReportRecord
   
    For Each Record In LstMed.Records
        MsgBox LstMed.FocusedRow.Record(M1).Value
     Next
this code will display the same value for the number of records existing in the reportcontrol. WHY?? something is missing...
 
how can I be able to display for the rest of reocrds?
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2007 at 6:19pm
Why did you mentioned FocusedRow in code???

In this case try only MsgBox Record(M1).Value

--
WBR,
Serge
Back to Top
moe188 View Drop Down
Senior Member
Senior Member


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2007 at 6:29pm
thank you,
it works just fine.
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.141 seconds.