Print Page | Close Window

DropRecords from one RC to another

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4031
Printed Date: 17 November 2024 at 9:43am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DropRecords from one RC to another
Posted By: John31
Subject: DropRecords from one RC to another
Date Posted: 19 April 2006 at 4:09pm

Is there a sample available that shows how to modify the records being dropped into a report control?  I am aware of the existing sample using Ole and List boxes.

Take the following:

2 Report Controls, RC1 and RC2 with different columns.

Drag rows from RC1 to RC2.

In the DropRecords event of RC2 the records need to be adjusted to appear in the correct columns of RC2. The code below shows how I think you would do it.  However, the step in bold appears to do nothing.  What am I doing wrong?

 

' create a new records collection that will be populated with converted data and then
    ' replace the records passed in the event
    Set oRecords = RC2.CreateRecords
   
    If m_bDragFromRC1 Then
        m_bDragFromRC1 = False
        For i = 0 To Records.Count - 1
             ' get a ref to the old object
             Set oRec = Records(i)
             ' create a new record
             Set oNewRec = oRecords.Add
             oNewRec.AddItem ""
             oNewRec.AddItem("").Icon = ID_DSS
             oNewRec.AddItem GetFirstL(oRec(COL_USER_NAME).Value)
             oNewRec.AddItem oRec(COL_USER_DEPT).Value
             oNewRec.AddItem oRec(COL_USER_EXT).Value
             oNewRec.AddItem "Extension"
        Next i
       
        ' replace with the new collection
        Set Records = oRecords
    End If



-------------
Regards

John Layton



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