Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - SOLVED:Get RowNumber
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SOLVED:Get RowNumber

 Post Reply Post Reply
Author
Message
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Topic: SOLVED:Get RowNumber
    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!
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: 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....
Back to Top
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post 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..
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: 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....
Back to Top
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post 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!
Back to Top
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Posted: 21 September 2010 at 8:34am
btw, how can is  tag this topic as resolved?

 tnx
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: 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....
Back to Top
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Posted: 21 September 2010 at 10:11am
thank you so much Aaron.. its solved my problem!
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.145 seconds.