Print Page | Close Window

SOLVED:Get RowNumber

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=17288
Printed Date: 15 November 2024 at 1:50pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED:Get RowNumber
Posted By: JamGodz
Subject: SOLVED:Get RowNumber
Date Posted: 21 September 2010 at 2:20am
Hi!


Just wanna know on how to get the rownumber of the created row number column..

for example i have declared the .CreateRowNumberColumn then in BeforeDrawRow i want to get the rownumber value of created row number.


Thank you!



Replies:
Posted By: Aaron
Date Posted: 21 September 2010 at 3:18am
Hi,
 
You aren't able to retrieve the numbers of that column but you are able to get index with Row.Record.Index to get rownumber. Actually is same index (CreateRowNumberColumn) as you added records to RC.
 
 


-------------
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: JamGodz
Date Posted: 21 September 2010 at 3:27am
hi Aaron.. thank for your reply..

i have tried the Debug.Print Row.Record.Index in BeforeDrawRow event... but ive got
error: object variable or with block variable not set.

thank you.... please i really need help on this..


Posted By: Aaron
Date Posted: 21 September 2010 at 4:03am
Hi,
 
Are you using ReportControl Virtualmode?
 
As I said in another post, upload small demo and add some info for the things you want to accomplish and I will see what I can do Wink
 
 
 


-------------
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: JamGodz
Date Posted: 21 September 2010 at 8:31am
Hi Aaron' Thank you so much... ive figured out the problem.... below are my solution... please advice if im mistaken something... i put a condition if Not Row.Group coz i added a grouporder.

    If Not Row.GroupRow Then
        If Row.Record.Index < rs.RecordCount Then
            rs.AbsolutePosition = Row.Record.Index + 1: rs.Move 0
            Row.Record(COLUMN_ICON_STATUS).Tag = rs.Fields![POSTED]
            With Row.Record(COLUMN_ICON_STATUS)
                Select Case .Tag
                    Case "P"
                        .Icon = RECORD_BLUE_ICON
                        .ToolTip = "Posted"
                        Row.Record(COLUMN_KMDIST).Editable = False
                    Case "R"
                        .Icon = RECORD_RED_ICON
                        .ToolTip = "REMARKS:" & vbCrLf & rs.Fields![REMARKS]
                    Case Else: .Icon = RECORD_GREEN_ICON
                End Select
            End With
        End If
    End If


thank you!


Posted By: JamGodz
Date Posted: 21 September 2010 at 8:34am
btw, how can is  tag this topic as resolved?

 tnx


Posted By: Aaron
Date Posted: 21 September 2010 at 9:29am
Hi,
 
I didn't know you use BeforeDrawRow event to load data from recordset. If I look at your code (because I said you are able to retrieve index of row with Row.Record.Index but in Virtualmode you have only ONE record) you are using Row.Record.Index and that is wrong. Row.Record.Index will always return 0 (in your case 1, because of Row.Record.Index + 1) 
 
If Not Row.GroupRow Then
        If Row.Record.Index < rs.RecordCount Then
            rs.AbsolutePosition = Row.Record.Index + 1: rs.Move 0
 
Just remove .record and it's OK
btw line: If Not Row.GroupRow Then is a good thing to do in BeforeDrawRow event Wink 
 
 
 
 


-------------
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: JamGodz
Date Posted: 21 September 2010 at 10:11am
thank you so much Aaron.. its solved my problem!



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