[SOLVED] OLE Drag&Drop doesn't work |
Post Reply |
Author | |
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Look in this sample please -
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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.
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
This code (specific for ActiveX case) was add in 13.0 and not exist in 12.1
#ifdef _XTP_ACTIVEXBOOL 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); |
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
ijwelch
Senior Member Joined: 20 June 2006 Status: Offline Points: 262 |
Post Options
Thanks(0)
|
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 |
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
ijwelch
Senior Member Joined: 20 June 2006 Status: Offline Points: 262 |
Post Options
Thanks(0)
|
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 |
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
ijwelch
Senior Member Joined: 20 June 2006 Status: Offline Points: 262 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Fabian - this is a reason I attached you working ext drag-drop sample - please analyze it
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi Fabian,
I tried with test project 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.... |
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
There is a way to change red line to other color - check PaintManager settings |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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)
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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
I don't want you to say that you don't have RC V13.1 so I attached you this version
uploads/20091024_095934_Codejock.Report.Zip (just change extension into .ocx)
and to make it easy for you here's demo also
|
|
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.... |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
You can re-test your VB app with direct drop selection to Excel with modified
https://forum.codejock.com/uploads/BetaOCX/ReportControlBeta13-2.rar It works now. |
|
jequita2009
Newbie Joined: 29 July 2010 Location: Peru Status: Offline Points: 3 |
Post Options
Thanks(0)
|
hello guys, the file
uploads/20091024_095934_Codejock.Report.Zip comes with error , I see its contents, can publish it again? Pleaseeeeeee thanks. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |