Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Imran Khan
  Where is Imran Khan?
 Lahore
 Pakistan
 Imran Khan
 Tags
Subject: RE: Report Preview problem with Desktop=.T.
Thread ID: 248883 Message ID: 248935 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Friday, December 25, 2009 10:12:43 AM         
   


> >
> > Make your print preview appear in it's own form.
> >
PUBLIC oForm
> > oForm = CREATEOBJECT("Form")
> > WITH oForm
> >  .Caption = "whatever"
> >  .WindowState = 2    && Maximized
> >  .Show()
> > ENDWITH
> > REPORT FORM yourreport PREVIEW WINDOW (oForm.Name)
> > oForm.Release()

> >
> > Mike Gagnon
> > Refox XI +(English version)
>
>
> Preview Toolbar disappear?
>

Not necessarily - if yours does, quite likely the window wherein you want to display the preview may not be visible yet. Or, if Set('Resource')='ON', your current 'foxuser' files may have stored undesired toolbar settings:

LOCAL lScreenVisible, lcSetResource
lScreenVisible = _screen.Visible
_screen.Visible = .F.
lcSetResource = SET("Resource")
SET RESOURCE OFF

LOCAL oForm
oForm = CREATEOBJECT('PreviewForm')
oForm.Show()
MakeReport(m.oForm)
oForm.Release()

ERASE testfrx.*
_screen.Visible = m.lScreenVisible
SET RESOURCE &lcSetResource
RETURN

DEFINE CLASS PreviewForm as Form
	ShowWindow = 2
	Titlebar = 0
	WindowState = 2
ENDDEFINE

PROCEDURE MakeReport(toForm)
	ASSERT ( VARTYPE(m.toForm) = 'O' )
	LOCAL i, cFile
	CREATE CURSOR temp (test C(10))
	FOR i = 1 TO 100
		INSERT INTO temp VALUES (SYS(2015))
	ENDFOR
	cFile = 'testfrx'
	CREATE REPORT (m.cFile) FROM temp
	REPORT FORM (m.cFile) PREVIEW WINDOW (toForm.Name)
ENDPROC



hth
-Stefan

ENTIRE THREAD

Report Preview problem with Desktop=.T. Posted by Imran Khan @ 12/24/2009 11:38:33 AM
RE: Report Preview problem with Desktop=.T. Posted by Mike Gagnon @ 12/24/2009 12:20:06 PM
RE: Report Preview problem with Desktop=.T. Posted by Imran Khan @ 12/24/2009 2:01:54 PM
RE: Report Preview problem with Desktop=.T. Posted by Stefan Wuebbe @ 12/25/2009 10:12:43 AM