Print Page | Close Window

How to Append a new 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=11188
Printed Date: 10 November 2024 at 8:40am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to Append a new row
Posted By: slvrbllt
Subject: How to Append a new row
Date 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

 




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


Posted By: slvrbllt
Date 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 ? :-)


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


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


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


Posted By: Aaron
Date 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
 
https://forum.codejock.com/uploads/20080707_125342_AddRecordEx.zip - uploads/20080707_125342_AddRecordEx.zip


-------------
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....



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