Print Page | Close Window

[SOLVED] OLE Drag&Drop doesn't work

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=15251
Printed Date: 21 November 2024 at 6:16pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] OLE Drag&Drop doesn't work
Posted By: Fabian
Subject: [SOLVED] OLE Drag&Drop doesn't work
Date Posted: 27 September 2009 at 5:43am
Hi
 
Working with V13.1.0, VB6/SP6
 
I make the following:
 
ReportControl1.OLEDropMode=xtpOLEDropManual
ReportControl1.EnableDragDrop "XYZ",xtpReportAllowDrop
 
'Filling the RC
 
ReportControl1.Populat
 
Now I try to drag/drop an Item from the Windows explorer. I see the D&D cursor but ReportControl1_OLEDragDrop() was never called.
 
What do I wrong???
 
Thanks for any help


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6



Replies:
Posted By: mdoubson
Date Posted: 27 September 2009 at 9:37am
Look in this sample please -
https://forum.codejock.com/uploads/20090927_093901_ReportControl-O.rar - uploads/20090927_093901_ReportControl-O.rar


-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 27 September 2009 at 11:02am
Hi Mark
 
Thanks for sample. But this is far too complicated for my needs. RC has an OLEDragDrop event - but it wasn't fired on drop. What do I wrong? I checked this in V12.1 an it works !!!
 
regards


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 27 September 2009 at 11:41am
You code allows to drop "XYZ" clipboard format content - Windows Exporer does not have it.
Open Clipboard Viewer and check clipboard format after your drag file from Windows Explorer.


-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 27 September 2009 at 11:56am
Hi Mark
 
I used in OLEDragDrop in V12.1:
 
Dim DroppedFiles as XtremeReportControl.DataObjectFiles
 
If data.GetFormat(vbCFFiles) Then
  Set DroppedFiles=data.Files
  For i=1 to DroppedFiles.Count
  ...
 
But in 13.x OLEDragDrop was NOT fired at all!
 
Thanks


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 27 September 2009 at 12:26pm
This code (specific for ActiveX case) was add in 13.0 and not exist in 12.1

#ifdef _XTP_ACTIVEX

BOOL bSkipOLEDrop = (m_dwDragDropFlags & xtpReportAllowDrop) && !IsVirtualMode() && pDataObject &&

pDataObject->IsDataAvailable(m_cfReport);

if (m_nOLEDropMode && pDataObject && !bSkipOLEDrop) {

CXTPOleDataObject::FireOleDropEvent((COleControl*)GetParent(), pDataObject, dropEffect, point);

return dropEffect != DROPEFFECT_NONE; }

#endif

where m_cfReport = (CLIPFORMAT)::RegisterClipboardFormat(lpszClipboardFormat);


-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 28 September 2009 at 1:47am
And how does this help me to do what in V12.1 works? Please make it possible or tell me how to fire OLEDragDrop event!!!
 
 
Thanks


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: ijwelch
Date Posted: 28 September 2009 at 3:57am
I think you need to add some code in the OLEDragOver event to enable drop effect. For example:


Private Sub wndReportControl_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 Data.GetFormat(vbCFFiles) Then
    Effect = cc2OLEDropEffectCopy
End If
End Sub


This works for me in 13.1.

-------------
ExtremeSuitePro 12.1.1
WinXP SP3


Posted By: Fabian
Date Posted: 28 September 2009 at 7:06am
Hi ijwelch
 
I tried this but without success. I replaced cc2OLEDropEffectCopy by vbDropEffectCopy (1). What are your initial settings for ReportControl1.OLEDropMode and Reportcontrol1.EnableDragDrop?
 
And with your example, OLEDragDrop was fired???
 
It would be great if I can use this like in V12.1. I don't know why working behaviours would be removed or changed => Mark!
 
Thanks for any help in my and the name of my customers


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: ijwelch
Date Posted: 28 September 2009 at 7:41am
Originally, I didn't call EnableDragDrop at all. I just tried it and doesn't seem to make any difference to my simple demo-still works. Seems to me that EnableDragDrop is for dragging records around within the report control.

For my example (dragging files onto report from Explorer) just set OLEDropMode to 1. And yes, OLEDragDrop is fired.

To reproduce, open the VB\ReportSample, set OLEDropMode to 1, and add my code to OLEDragOver.

This all works for me in 13.1 evaluation. WinXPsp3.

-------------
ExtremeSuitePro 12.1.1
WinXP SP3


Posted By: Fabian
Date Posted: 28 September 2009 at 8:14am
Thanks a lot!
 
But with my version OLEDragDrow was never fired (not in my app nor in the ReportRecord sample). My OCX is dated AUG-16. 20:30 probably yours is newer. I tried this with 13.0 an it does not work. It only works from 12.1 backward. I checked this on a Win2000 machine and also under Vista but no success.
 
If you have any idea you'r welcome


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: ijwelch
Date Posted: 28 September 2009 at 9:19am
Would suggest you open support ticket. I expect the first thing they'll ask is if you've tried it with version 13.1 though.

-------------
ExtremeSuitePro 12.1.1
WinXP SP3


Posted By: mdoubson
Date Posted: 28 September 2009 at 11:26am
Fabian - this is a reason I attached you working ext drag-drop sample - please analyze it

-------------
Mark Doubson, Ph.D.


Posted By: Fabian
Date Posted: 29 September 2009 at 1:54am
Hi Mark
 
I looked at it, but I see not how I can use RC.OleDragDrop. It seems simply a work around for an omission in your code. It is a feature that worked in 12.1, it was specified in your help file but it doesn't work no more.
 
So please CJ publish corrected version 13.1.1 as soon as possible!!!


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: Aaron
Date Posted: 29 September 2009 at 2:06pm
Hi Fabian,
 
I tried with test project https://forum.codejock.com/forum_posts.asp?TID=11368 - https://forum.codejock.com/forum_posts.asp?TID=11368  and it works with V13.1 and V13.2 Beta
 
 


-------------
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: Fabian
Date Posted: 30 September 2009 at 5:31am
Thanks Aaron
 
Yes, this sample works - BUT only because the reportcontrol is empty. As soon as you have one or more records loaded and you remove the delete command it doesn't work no more. I will send an issue report to CJ
 
Tnaknks again


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: Aaron
Date Posted: 30 September 2009 at 7:51am
Hi Fabian,
 
I removed line: wndReportControl.Records.DeleteAll in sub wndReportControl_OLEDragDrop and it still works OK.
 
 


-------------
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: Fabian
Date Posted: 30 September 2009 at 9:19am
Hi Aaron
 
You are right. I solved the problem: OLE D&D does not work as soon as the sortorder is not empty. If you remove all columns from the sort order or you set the flag .SortedDragDrop then it works nearly as in V12. The only difference is, that there is a red insertion line - but that is cosmetic.
 
 
Thanks again


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: mdoubson
Date Posted: 30 September 2009 at 6:58pm

There is a way to change red line to other color - check PaintManager settings



-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 30 September 2009 at 7:00pm
Fabian - there is NO way to publish any of old CORRECTED version - all fixes and improvements always going to NEW version (in current case it will be 13.2)

-------------
Mark Doubson, Ph.D.


Posted By: Aaron
Date Posted: 24 October 2009 at 10:02am
Originally posted by Aaron Aaron wrote:

Hi Fabian,
 
I tried with test project https://forum.codejock.com/forum_posts.asp?TID=11368 - https://forum.codejock.com/forum_posts.asp?TID=11368  and it works with V13.1 and V13.2 Beta
 
 
 
Hi Mark,
 
But then again it doesn't work anymore when D&D rows onto Excel sheet with V13.2 (it worked with previous version V13.1) See demo https://forum.codejock.com/forum_posts.asp?TID=15364 - https://forum.codejock.com/forum_posts.asp?TID=15364
 
I don't want you to say that you don't have RC V13.1 so I attached you this version
 
https://forum.codejock.com/uploads/20091024_095934_Codejock.Report.Zip - uploads/20091024_095934_Codejock.Report.Zip  (just change extension into .ocx)
 
and to make it easy for you here's demo also
 
https://forum.codejock.com/uploads/20091024_100216_CreateXLSFile.zip - uploads/20091024_100216_CreateXLSFile.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....


Posted By: mdoubson
Date Posted: 24 October 2009 at 3:25pm
To export in excel file after sort applied:
Private Function CreateArray()
Dim record As XtremeReportControl.ReportRecord
Dim row As XtremeReportControl.ReportRow
Dim recordItem As XtremeReportControl.ReportRecordItem
    'this will also create array with non visible items, loop through rows if you want only visible items.
    'Maybe you want to do filtering on records and only want those in xls file.
    ReDim arrayRCValues(wndReportControlFiles.Records.Count, wndReportControlFiles.Columns.Count)
'    For Each record In wndReportControlFiles.Records
'        For Each recordItem In record
'            arrayRCValues(record.Index, recordItem.Index) = recordItem.Caption
'        Next recordItem
'    Next record
    For Each row In wndReportControlFiles.Rows
        Set record = row.record
        For Each recordItem In record
            arrayRCValues(row.Index, recordItem.Index) = recordItem.Caption
        Next recordItem
    Next row
End Function
 
If you want to use drag and drop to change sort after - use new mode
SortedDragDrop = True


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 24 October 2009 at 8:00pm
You can re-test your VB app with direct drop selection to Excel with modified
https://forum.codejock.com/uploads/BetaOCX/ReportControlBeta13-2.rar - https://forum.codejock.com/uploads/BetaOCX/ReportControlBeta13-2.rar
It works now.

-------------
Mark Doubson, Ph.D.


Posted By: jequita2009
Date Posted: 30 July 2010 at 9:24am
hello guys, the file
uploads/20091024_095934_Codejock.Report.Zip

comes with error , I see its contents, can publish it again?

Pleaseeeeeee
thanks.



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