Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] OLE Drag&Drop doesn't work
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] OLE Drag&Drop doesn't work

 Post Reply Post Reply
Author
Message
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] OLE Drag&Drop doesn't work
    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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2009 at 9:37am
Look in this sample please -
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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);
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 28 September 2009 at 11:26am
Fabian - this is a reason I attached you working ext drag-drop sample - please analyze it
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2009 at 2:06pm
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....
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 30 September 2009 at 6:58pm

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

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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 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
 
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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
It works now.
Back to Top
jequita2009 View Drop Down
Newbie
Newbie


Joined: 29 July 2010
Location: Peru
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote jequita2009 Quote  Post ReplyReply Direct Link To This Post 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.
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.172 seconds.