Print Page | Close Window

Detect Records Value

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=8182
Printed Date: 12 November 2024 at 8:34pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Detect Records Value
Posted By: moe188
Subject: Detect Records Value
Date 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!!!!

     



Replies:
Posted By: joeliner
Date 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,


Posted By: moe188
Date Posted: 27 September 2007 at 2:04pm
no luck,
I tried your code, but it did not do anything at all.


Posted By: sserge
Date 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


Posted By: moe188
Date 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


Posted By: sserge
Date 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


Posted By: moe188
Date 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?
 


Posted By: sserge
Date 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


Posted By: moe188
Date Posted: 10 October 2007 at 6:29pm
thank you,
it works just fine.



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