Print Page | Close Window

report control drog and drop (SOLVED)

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=11701
Printed Date: 20 July 2025 at 7:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: report control drog and drop (SOLVED)
Posted By: nenkalo
Subject: report control drog and drop (SOLVED)
Date Posted: 02 August 2008 at 5:34pm
hi dear

i want to making two report controls for drog and drop records from one to other control .

for examle in report1 we have 10 records and report2 is empty .
report1 is source and  report2 is destination .


when  we drag one record from source to destination then  report1  has 9 records and report2 has 1 record .

but when u pressed "ctrl" and drag any record from any report control to itself , this record duplicate in report !

how i can fix it ?



Replies:
Posted By: Aaron
Date Posted: 03 August 2008 at 5:18am
Hi,
 
You allow droprecords by setting:
 
cfRecordsSource = wndReportSource.EnableDragDrop("ReportSample:frmDragDrop", xtpReportAllowDrag Or xtpReportAllowDrop)
 
cfRecordsDestination = wndReportSource.EnableDragDrop("ReportSample:frmDragDrop", xtpReportAllowDrag Or xtpReportAllowDrop)
 
if you set this with both RC's you are able to drag&drop records in both RC's. That's not what you want.
 
 
If you set the source only for dragging and destination for dropping:
 
cfRecordsSource = wndReportSource.EnableDragDrop("ReportSample:frmDragDrop", xtpReportAllowDrag)

cfRecordsDestination = wndReportDestination.EnableDragDrop("ReportSample:frmDragDrop", xtpReportAllowDrop)
 
 
allows you to move or copy the selected records only from source to destination.
 
 
btw If your issue is solved, please add SOLVED in your Topic description and have a look at post http://forum.codejock.com/forum_posts.asp?TID=11225 - http://forum.codejock.com/forum_posts.asp?TID=11225



-------------
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: nenkalo
Date Posted: 03 August 2008 at 6:04am
tnx sir !

but by limit draging in first RC and limit dropping in another RC user cant move records from RC1 to RC2 and from RC2 to RC1 !

i want to have biderctional drag and droping between RCs .

user must move any record from any report control to another control freely . but must always sum of record in two report control be fix. (copy from one control to itself is invalid . in fact this is my problem !)

tnx



Posted By: Aaron
Date Posted: 03 August 2008 at 7:25am
Hi,
 
I was testing your issue and found I was doing something wrong myself (I changed my previous reply as well, not to confuse other users)
 
To disable copying records with CTRL down you can use the events:
 
Private Sub wndReportSource_OLEDragOver(ByVal Data As XtremeReportControl.DataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single, ByVal state As Integer)
    If ((Shift And 2) = 0) Then
        Effect = vbDropEffectMove
    Else
        Effect = vbDropEffectNone
    End If
End Sub
Private Sub wndReportDestination_OLEDragOver(ByVal Data As XtremeReportControl.DataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single, ByVal state As Integer)
    If ((Shift And 2) = 0) Then
        Effect = vbDropEffectMove
    Else
        Effect = vbDropEffectNone
    End If
End Sub
 
also set:
 
wndReportSource.OLEDropMode = xtpOLEDropManual
wndReportDestination.OLEDropMode = xtpOLEDropManual

 
and cursor will be changed to NODROP when CTRL is down and now you can only move the records.
 
 
 
 


-------------
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: nenkalo
Date Posted: 03 August 2008 at 7:51am
really tnx dear
;)

i change titel to solved immediately ;)



but 1 smaill question

when we have report control on form and set form.keypreview = true
"ESC" code not detected by form when report control have focus .

can u help me abt this ?




Posted By: Aaron
Date Posted: 03 August 2008 at 8:34am
Hi,
 
try this:
 
Private Sub wndReportSource_PreviewKeyDown(KeyCode As Integer, ByVal Shift As Integer, Cancel As Boolean)
    Me.Caption = KeyCode
End Sub
 
Please add SOLVED: <your topic description> and enter your info in your signature as well
 
 


-------------
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: nenkalo
Date Posted: 03 August 2008 at 9:03am
Originally posted by Aaron Aaron wrote:

Hi,
 
try this:
 
Private Sub wndReportSource_PreviewKeyDown(KeyCode As Integer, ByVal Shift As Integer, Cancel As Boolean)
    Me.Caption = KeyCode
End Sub


hi . tnx . i know this way . but i want to find one solution to reciving keycode pressed in form . anyway its not important . tnx for everythings ...


Originally posted by Aaron Aaron wrote:


Please add SOLVED: <your topic description> and enter your info in your signature as well


i do it


-------------
Product: Xtreme SuitePro (ActiveX) version 12.0.1
Platform: Windows XP (32bit)
Language: Visual Basic 6.0



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