Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - How to Append a new row
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to Append a new row

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

Joined: 16 September 2006
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote slvrbllt Quote  Post ReplyReply Direct Link To This Post Topic: How to Append a new row
    Posted: 24 June 2008 at 11:15am

Hello,

I would like to insert a new record at the very bottom of an existing Report control by using the AddRecordEx method.

Unfortunately the new row is always added on top of the other rows and not at the end of the list.

[...]
Dim tmpRec As ReportControl

'Create tmpRec and populate its items

OtherObject.rptList.AddRecordEx tmpRec
[...]

Any clue ?

Maurizio

 

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: 24 June 2008 at 11:27am
Hi,
 
Just use:
 
Dim i, j As Long
Dim XtremeRecord As XtremeReportControl.ReportRecord
Dim XtremeRecordItem As XtremeReportControl.ReportRecordItem

    For i = 0 To 10
        Set XtremeRecord = wndReportControl.Records.Add()
            For j = 0 To 10
                Set XtremeRecordItem = XtremeRecord.AddItem(i & " - " & j)
            Next j
    Next i
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
slvrbllt View Drop Down
Groupie
Groupie
Avatar

Joined: 16 September 2006
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote slvrbllt Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2008 at 4:24am

Thanks for your reply, Aaron!

I am afraid I haven't been clear enough. Sorry for that!
I surely now how to add a new row using the "Add" method. Infact my question included the clause "by using the AddRecordEx method"
 
Oddly the ".Add" method appends a row at the end, while ".AddRecordEx" insert it at the top ! I expected that all the "Add..." methods behaved consistently...
You'd surely agree that it is much more easier to insert a new record by typing:
 
ReportControl.AddRecordEx newRecordObject
 
instead of going through a loop!
 
Any other clues ? Oleg ? :-)
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: 25 June 2008 at 5:37am
Hi,
 
I don't see a difference with AddRecord and AddRecordEx when adding NEW records to RC. You have to add your items anyway to the record itself (loop or no loop, you have to "create" the record anyway). But maybe I see it wrong and I would love to see a sample that would change my opinion.
 
But for your issue: I think you don't Call wndReportControl.Populate after you added the record
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
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: 27 June 2008 at 10:04am
Hi,
 
I thought so... Glad I could help you.
 
 
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
slvrbllt View Drop Down
Groupie
Groupie
Avatar

Joined: 16 September 2006
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote slvrbllt Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2008 at 11:56am
Originally posted by Aaron Aaron wrote:

Hi,
 
I don't see a difference with AddRecord and AddRecordEx when adding NEW records to RC. You have to add your items anyway to the record itself (loop or no loop, you have to "create" the record anyway). But maybe I see it wrong and I would love to see a sample that would change my opinion.
 
But for your issue: I think you don't Call wndReportControl.Populate after you added the record
 
Hi Aaron,
 
Sorry for getting back to you so late, but I've been away for a while.
Your suggestion doesn't help at all ! :-)
 
Like I said, AddRecordEx actually adds a new record on TOP of the others instead of at the bottom of the list, just like AddRecord does.
 
Anyway thank you for your replies. :-)
 
Bye.
 
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: 07 July 2008 at 12:53pm
Hi,
 
To prove it works as I say, here's a test project. Maybe you do something wrong, I don't know. Check the sample project yourself
 
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
 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.141 seconds.