>The old trick to maximize a report preview window no longer works in VFP9 using reportbehavior90?
>
>Use to be you could put this in the init method of the data environment:
>IF WEXIST('Report Designer')
> ZOOM WINDOW "Report Designer" MAX
>ENDIF
>
>
>Anyone know what the new simple trick is?
That is because VFP doesn't use Report Designer window to preview the report when you use SET REPORTBEHAVIOR 90. It uses frxPreviewForm form defined in frxPreview.vcx of REPORTPREVIEW.APP
Here what we use:
LOCAL oForm, wnd_name
LOCAL loRef as ReportListener
IF SET("ReportBehavior") == 80
oForm = CREATEOBJECT("Form")
oForm.Caption = [some caption]
oForm.Name = "PrintPreview"
oForm.WindowState = 2
oForm.Visible = .t.
wnd_name = oForm.Name
REPORT FORM (report name here) NOCONSOLE TO PRINTER PROMPT PREVIEW WINDOW (wnd_name)
ELSE
EXTERNAL CLASS frxPreview.vcx
oForm = NEWOBJECT([frxpreviewForm],[frxPreview],_REPORTPREVIEW)
loRef = NULL
DO (_REPORTOUTPUT) WITH 1, loRef
oForm.WindowState = 2
loRef.PreviewContainer = oForm
REPORT FORM (report name here) NOCONSOLE TO PRINTER PROMPT PREVIEW OBJECT loRef
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.