AfterAutoPageBreak problem with VPE 3.5 and VFP ?

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

AfterAutoPageBreak problem with VPE 3.5 and VFP ?

Postby EthicsGradient » Tue May 20, 2008 7:30 am

Hi all,

I have a situation where I have a function that generates a VPE Report with some header information that I set in the AfterAutoPageBreak event of the VpeControl.VpeControl.35 OLE control (instance is called VPEDoc).

First time through with a multipage report there are no problems and the AfterAutoPageBreak event fires for each page and creates the header, but if I generate the report again in the same session (by blowing away VPEDoc and recreating the report) the AfterAutoPageBreak event doesnt fire.

Anyone have any ideas ?

VPE 3.5 / Visual Foxpro 6&9...

Cheers,
Matt.
EthicsGradient
 
Posts: 16
Joined: Tue May 20, 2008 6:17 am

Postby IDEAL Software Support » Tue May 20, 2008 11:42 am

What does "blowing away VPEDoc" mean? Maybe you destroy the ActiveX and your event-listener is not reconnected to the control. To destroy the document, just call VPE.CloseDoc().
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby EthicsGradient » Wed May 21, 2008 2:52 am

Apologies... I'm new to both VFP and VPE and I'm still trying to get a handle on the framework.

I have a form in VFP (named VPEForm) with the VPE ActiveX control embedded (named VPEDoc) on the form.

What I meant by "blowing VPEDoc away and recreating it" was that we release the form in VFP and reinstantiate it, thereby reinstantiating the ActiveX control (VPEDoc) as well.

Would this have an effect on the ActiveX event listeners ?

One of the things that bothers me is that the process for instantiating the VPE ActiveX object the first time is the same as the second (ie. we instantiate the form that contains the control) so I should see the problem in both cases, shouldnt I ?

Matt.
EthicsGradient
 
Posts: 16
Joined: Tue May 20, 2008 6:17 am

Postby IDEAL Software Support » Wed May 21, 2008 8:07 pm

To be honest, we do not know Visual FoxPro. The VPE ActiveX has definitely no problems in being re-instantiated. Maybe you should ask in a Visual FoxPro group about the general use and instantiation of ActiveX controls.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

answer

Postby EthicsGradient » Thu May 29, 2008 12:47 am

Ok. Solved it.

For anyone else who has trouble with this, you need to set .AutoYield to false (.F.) in your foxpro app. before making use of the ActiveX object.

cheers,
Matt.
EthicsGradient
 
Posts: 16
Joined: Tue May 20, 2008 6:17 am

Postby IDEAL Software Support » Thu May 29, 2008 9:10 am

Thanks for your update.

(BTW, the AutoYield thing is described in the readme of the VFOX sample files of VPE.)
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 13 guests

cron