Print Page | Close Window

Plz. help me out. How to retrieve value from 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=16868
Printed Date: 15 November 2024 at 12:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Plz. help me out. How to retrieve value from row?
Posted By: Sunil_Patel
Subject: Plz. help me out. How to retrieve value from row?
Date 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



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



Posted By: Sunil_Patel
Date Posted: 24 June 2010 at 9:00am
Hi! and thanks for your reply and sorry to say friends but it is giving nothing....

-------------
Sunil


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



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



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


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


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


Posted By: Sunil_Patel
Date Posted: 05 July 2010 at 1:32pm
Hi! Aaron, thanks for your help and and its working fine.. and please keep writing.... 

-------------
Sunil


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



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