Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp9 report preview max zoom trick broken
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01272340
Message ID:
01272692
Views:
146
This message has been marked as the solution to the initial question of the thread.
>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   && Maximised
   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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform