Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Plz. help me out. How to retrieve value from row?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Plz. help me out. How to retrieve value from row?

 Post Reply Post Reply
Author
Message
Sunil_Patel View Drop Down
Newbie
Newbie
Avatar

Joined: 22 June 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sunil_Patel Quote  Post ReplyReply Direct Link To This Post Topic: Plz. help me out. How to retrieve value from row?
    Posted: 22 June 2010 at 8:17am

Please help me out..... How to retrieve value from selected row?

code for Visual Basic 6.0







Sunil
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2010 at 4:07pm
Assuming you have set FocusSubItems = True, this should work:


With Me.ReportControl1
    .FocusedRow.Record.Item(.FocusedColumn.ItemIndex).Value
End With

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Sunil_Patel View Drop Down
Newbie
Newbie
Avatar

Joined: 22 June 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sunil_Patel Quote  Post ReplyReply Direct Link To This Post Posted: 24 June 2010 at 9:00am
Hi! and thanks for your reply and sorry to say friends but it is giving nothing....
Sunil
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 28 June 2010 at 2:21pm
Are you using VirtualMode?

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 28 June 2010 at 8:12pm
Are you trying to retrieve every cell value on the row?


Dim i As Long

For i = 0 To Me.ReportControl1.Columns.Count
    Debug.Print Me.ReportControl1.FocusedRow.Record.Item(Me.ReportControl1.Columns(i).Index).Value
Next i


Should work.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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: 29 June 2010 at 9:22am
Hi,
 
Did you add RecordItems with "" and assigned a value to .Caption afterwards ? (if so just use .Caption instead of .Value in code Jason showed, or assign a value to .Value when adding ReportItems)
 
 
or maybe you need:
  • index of row:           wndReportControl.FocusedRow.Index
  • index of record:      wndReportControl.FocusedRow.Record.Index
 
 
You have to be more specific when posting a thread...
 
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
Sunil_Patel View Drop Down
Newbie
Newbie
Avatar

Joined: 22 June 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sunil_Patel Quote  Post ReplyReply Direct Link To This Post Posted: 30 June 2010 at 8:44am
thanks for your reply friends and i tried your code but its giving me a blank value.... how i am adding data in report control, some source code is below:

Source code
----------------


Public Function Report_Generator()
    wndReportControl.Records.DeleteAll
    wndReportControl.Columns.DeleteAll
    Dim Column As ReportColumn
    Dim fcount, rsfield
    wndReportControl.AllowColumnSort = True
    Const COLUMN_NAME = 1
    fcount = rsList.Fields.Count
    rsfield = 0
    Dim i As Long, Record As ReportRecord, Item As ReportRecordItem, str As String

    Do While fcount > 0
        Set Column = wndReportControl.Columns.ADD(rsfield, rsList.Fields(rsfield).Name, 130, True)
        Column.Visible = True
        fcount = fcount - 1
        rsfield = rsfield + 1
    Loop
    Call AddCol
    ' Set flat column style
'    wndReportControl.PaintManager.ColumnStyle = xtpColumnFlat
    ' Populate report data items
    wndReportControl.Populate
    wndReportControl.FocusSubItems = True
    wndReportControl.SetCustomDraw xtpCustomBeforeDrawRow
End Function

Function AddCol()
    Dim i As Long, Record As ReportRecord, Item As ReportRecordItem, str As String
    Dim rsf
    rsf = 0
On Error Resume Next
    rsList.MoveFirst
    Do While rsList.EOF = False
        Set Record = wndReportControl.Records.ADD
        For rsf = 0 To rsList.Fields.Count - 1
            Set Item = Record.AddItem(str)
            Item.Format = rsList.Fields(rsf).Value
        Next rsf
        rsList.MoveNext
    Loop
    wndReportControl.Columns(0).Width = 31
    wndReportControl.Columns(1).Width = 51
    wndReportControl.Columns(2).Width = 51
    wndReportControl.Columns(3).Width = 51
    wndReportControl.Columns(4).Width = 50
    wndReportControl.Columns(5).Width = 50
    wndReportControl.Columns(6).Width = 40
End Function



if is there any alternate option please provide me.... ur feedback is most welcome.....
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: 03 July 2010 at 3:04am
Hi,
 
I don't see that str gets assigned a value from recordset... so you are assigning "empty" value to ReportItem
 
        ....      
        Do While rsList.EOF = False
        Set Record = wndReportControl.Records.ADD
        For rsf = 0 To rsList.Fields.Count - 1
            Set Item = Record.AddItem(str)  
            Set Item = Record.AddItem(rsList.Fields(rsf).Value) 'think you need to do this

            Item.Format = rsList.Fields(rsf).Value 'What's this suppost to do??? See .Format property in Help file
        Next rsf
        rsList.MoveNext

        .....
 
 
 
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
Sunil_Patel View Drop Down
Newbie
Newbie
Avatar

Joined: 22 June 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sunil_Patel Quote  Post ReplyReply Direct Link To This Post Posted: 05 July 2010 at 1:32pm
Hi! Aaron, thanks for your help and and its working fine.. and please keep writing.... 
Sunil
Back to Top
Sunil_Patel View Drop Down
Newbie
Newbie
Avatar

Joined: 22 June 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sunil_Patel Quote  Post ReplyReply Direct Link To This Post Posted: 05 July 2010 at 1:33pm
thanks dud.... and keep writing.....



Originally posted by Aaron Aaron wrote:

Hi,
 
I don't see that str gets assigned a value from recordset... so you are assigning "empty" value to ReportItem
 
        ....      
        Do While rsList.EOF = False
        Set Record = wndReportControl.Records.ADD
        For rsf = 0 To rsList.Fields.Count - 1
            Set Item = Record.AddItem(str)  
            Set Item = Record.AddItem(rsList.Fields(rsf).Value) 'think you need to do this

            Item.Format = rsList.Fields(rsf).Value 'What's this suppost to do??? See .Format property in Help file
        Next rsf
        rsList.MoveNext

        .....
 
 
 
Sunil
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.125 seconds.