Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - InsertAt: move or copy?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

InsertAt: move or copy?

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

Joined: 01 February 2007
Location: Italy
Status: Offline
Points: 66
Post Options Post Options   Thanks (0) Thanks(0)   Quote Albert1 Quote  Post ReplyReply Direct Link To This Post Topic: InsertAt: move or copy?
    Posted: 08 September 2011 at 10:56am
I am looking for a swap records function. From CJ help:
 
InsertAt will move an existing ReportRecord to the specified index.
 
So I wrote this code:
 

Private Sub Form_Load()
    With ReportControl1
        .Width = 8000
        .Height = 4000
        .Move 0, 0
        .Columns.Add 0, "A", 100, True
        .Columns.Add 1, "B", 100, True
        With .Records.Add
            .AddItem "1.1"
            .AddItem "1.2"
        End With
        With .Records.Add
            .AddItem "2.1"
            .AddItem "2.2"
        End With
        With .Records.Add
            .AddItem "3.1"
            .AddItem "3.2"
        End With
       
        .Records.InsertAt 3, .Records(0)
        .Populate
    End With
End Sub
 
The result is:
 
 
The first record is copied to a new 4th record. This is a copy, not a move. Someone can please confirm it?
 
The best strategy to swap two records by code is InsertAt/RemoveAt
 
 
 
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0

Platform: Windows Vista (32bit) - SP 2

Language: Visual Basic 6.0 (SP6)

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