Preview Toolbar not enabled in EXE

The Preview Toolbar in VFP9 is not enabled when a report is generated to Preview from a compiled EXE. _reportbehavior is set to 90. The 90 preveiw toolbar is displayed

The application runs from a main form (modeless, as Top Level Form). Displays all reports to a preview form that is is either modal/modeless and In top level form. I have tried as Top Level Form and In Top Level Form. I have created the report two different ways

1> In the defined 'printpreview' window (form)

LOCALopform, lorl, lorp

SET CLASSLIB TOprintpreviewADDITIVE

opform =CREATEOBJECT('printpreview')

opform.VISIBLE= .T.&& open printpreview form

lorp =_REPORTPREVIEW

DO(_REPORTPREVIEW)WITHlorp

lorl =CREATEOBJECT('ReportListener')

lorl.LISTENERTYPE= 1

rptcaption =LEFT(rpt_form,LEN(rpt_form)-4)

lorl.PRINTJOBNAME= rptcaption

lorl.PREVIEWCONTAINER= lorp

REPORT FORM&qrpt_formNOCONSOLE OBJECT lorl PREVIEW WINDOWprintpreviewIN WINDOWprintpreview

RELEASEopform

RELEASE CLASSLIBprintpreview

2> And without the window form

REPORT FORM&qrpt_formOBJECTlorl

In both cases from the compiled EXE the Toolbar is not enabled. I am able to access the equivalent functions by right-clicking from the report body. When run from within the development environment, the toolbar is enabled.

Any guidance would be appreciated on how to enable the toolbar.

Thanks!

[3928 byte] By [WEPHenn] at [2008-2-7]
# 1

I think setting the TopForm property of the PreviewContainer object before you run the report will enable the toolbar in a top level form.

lorp.TopForm = .t.

RStanton at 2007-9-8 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...
# 2
Rick,

Thanks for the recommendation. However, I cannot find a TopForm property. It did not accept that setting. Could you please expand on your recommendaton.

W.

WEPHenn at 2007-9-8 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...
# 3
After a lot of trial and error the following process works:

1. In the main prg that calls the main form:

PUBLIC opform

SET SYSMENU OFF

_SCREEN.LOCKSCREEN = .T.

_SCREEN.VISIBLE = .F.

_SCREEN.CAPTION = "System-Print Preview"

_SCREEN.ICON = SYS(5)+SYS(2003)+"\fancy.ico"

_SCREEN.WINDOWSTATE = 2

_SCREEN.LOCKSCREEN = .F.

SET CLASSLIB TO printpreview ADDITIVE

opform = CREATEOBJECT('printpreview') && only worked properly from main prg

opform.VISIBLE = .T.

2. In the report initiating form:

LOCAL lorl, lorp

lorp =_REPORTPREVIEW

DO (_REPORTPREVIEW) WITH lorp

lorl = CREATEOBJECT('ReportListener')

lorl.LISTENERTYPE = 1

lorl.PRINTJOBNAME = qrpt_form

lorl.PREVIEWCONTAINER = lorp

opform.VISIBLE = .T. && open printpreview form

_screen.Visible = .T. && it doesn't work without the screen visible

REPORT FORM &qrpt_form OBJECT lorl PREVIEW IN WINDOW printpreview

_screen.Visible = .F.

opform.visible = .F.

RELEASE lorl, lorp

Results: Toolbar was enabled, all functions worked!

WEPHenn at 2007-9-8 > top of Msdn Tech,Visual FoxPro,Visual FoxPro General...