Issues with Clickable Objects and Embedded Preview.

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Issues with Clickable Objects and Embedded Preview.

Postby Mr_Data_Guy » Tue Apr 10, 2012 11:46 pm

I have a demo version of the professional VPE that I am evaluating. I have taken the demo application, VB.Net version and have added a new VPE control to the screen to allow for an in-form preview. I then added code including what I think would create clickable objects. When I run the form and move my mouse cursor it changes to a hand icon when over the clickable area of the preview area, but when the mouse is clicked no event is fired.

Suggestions please.
Mr_Data_Guy
 
Posts: 8
Joined: Sat Apr 07, 2012 11:31 pm

Re: Issues with Clickable Objects and Embedded Preview.

Postby IDEAL Software Support » Wed Apr 11, 2012 10:25 am

Please see the demo source code of the Professional Edition. It has a demo titled "Clickable Objects and Charts", which demonstrates how to catch click events. Because the demo has a non-embedded window, we also tested this right now with the RTF demo. We did set RTF.ExternalWindow = false, RTF.ObjectID = 1 and added an event handler for the "ObjectClicked" event, and it works. (For embedding, we called also "RTF.Dock = DockStyle.Fill;" and did set the property "Visible = False" for all other controls). Tested under Win 7, 64-bit.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: Issues with Clickable Objects and Embedded Preview.

Postby IDEAL Software Support » Wed Apr 11, 2012 10:29 am

After reading your post a second time, there may be a misunderstanding. You can not catch generic click events. You need to set the porperty "ObjectID = <integer number>" before inserting an object. Objects inserted after setting the ObjectID receive this ID (it must be different from zero). When clicking onto such an object, the ObjectClicked event is fired, and the event-parameter contains the ObjectID of the clicked object.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: Issues with Clickable Objects and Embedded Preview.

Postby Mr_Data_Guy » Wed Apr 11, 2012 5:18 pm

I had a long reply all typed explaining all of the this and thats, that I was doing and how it was still not working.
But I figured it out. It was a VB.Net syntax issue.
Thank you for your response.

Please note that I have added a new VPE object to the form: Report

Code that was not working:
Code: Select all
   
        Private Sub Charts_ObjectClicked( ByVal sender As Object, _
             ByVal e As IDEALSoftware.VpeProfessional.VpeControl.ObjectClickedEventArgs) _
             Handles Charts.ObjectClicked


Code that works:
Code: Select all
   
        Private Sub Charts_ObjectClicked( ByVal sender As Object, _
               ByVal e As IDEALSoftware.VpeProfessional.VpeControl.ObjectClickedEventArgs) _
               Handles _
               Charts.ObjectClicked, _
               Report.ObjectClicked


To be clear what was missing was the link to the report object's ObjectClicked code. e.g. I never told the object what to do when the items on the preview page were clicked. I thought I had, but I did not provide the missing link.
Last edited by Mr_Data_Guy on Thu Apr 12, 2012 4:37 am, edited 1 time in total.
Mr_Data_Guy
 
Posts: 8
Joined: Sat Apr 07, 2012 11:31 pm

Re: Issues with Clickable Objects and Embedded Preview.

Postby IDEAL Software Support » Wed Apr 11, 2012 10:04 pm

We are not much into VB.NET. Isn't the event handler in VB generated automatically when you double-click in the property pane on the desired event? In C# it does.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: Issues with Clickable Objects and Embedded Preview.

Postby Mr_Data_Guy » Thu Apr 12, 2012 3:59 am

Isn't the event handler in VB generated automatically when you double-click in the property pane on the desired event? In C# it does.


Yes just like C#.

Problem was I was copying and pasting the demo code and never 'hooked up' the ObjectClicked event of the new VPE object. So this was in no way a VPE issue, it was my mistake.
Mr_Data_Guy
 
Posts: 8
Joined: Sat Apr 07, 2012 11:31 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 13 guests