Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Preview

Status
Not open for further replies.

AlastairOz

Technical User
Jul 27, 2010
81
AU
I have the property "desktop" set to .t. in a form,when I call a report preview, the preview is always behind the form.
Is there anyway to change this.
 
See the help on the desktop property: You should not use the Desktop property when you create Single Document Interface (SDI) applications in which you might want to hide the Visual FoxPro desktop window (_SCREEN). Instead, set the ShowWindow Property setting to 2 to create a top-level form.

If you don't want to change to top level forms rather than desktop forms, you'll need to create your own preview form with desktop = .t.:

Code:
Local loPreview
loPreview = CreateObject("previewform")
loPreview.Name = "winPreview"
Report Form (Home()+"\Tools\Filespec\60frx2.frx") Preview Window winPreview

Define Class Previewform as Form 
   Desktop = .t.
Enddefine

The class does not need to be defined by DEFINE CLASS, you can also use a form class of a VCX or use a SCX form you first create by DO FORM, that form mustn't be modal.

Bye, Olaf.
 
Thanks Olaf,
I followed the lead you provided and came up with this:

LOCAL loPreview
loPreview = NULL
DO (_REPORTPREVIEW) WITH loPreview

loPreview.CanvasCount = 1
loPreview.ZoomLevel = 4 && 75%
loPreview.Width = 850
loPreview.height = 900
loPreview.ToolbarIsVisible = .t.
loPreview.topform = .t.

loListener = CREATEOBJECT("ReportListener")
loListener.PreviewContainer = loPreview
lolistener.ListenerType = 1

REPORT FORM JobServiceCall OBJECT loListener


The property .topform keeps the report preview on top, and enables me to keep the desk top property on the form.
An added bonus is the report preview toolbar is docked on top of the preview form.
 
Okay, you're doing reports in the new way rather than by Report FORM, that's good anyway. The Reportpreviewapp creates the default frxpreviewproxy, which is not really the preview form itself, but a proxy to it. Actually a nicer solution, didn't thought of it. Good!

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top