Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simulating FoxUser behavior
Message
From
17/05/2011 13:19:12
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, United States
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01510886
Message ID:
01510890
Views:
93
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>We recently changed our application to not use Foxuser.dbf files (as it presented a problem with the Windows 7 when run with UAC on).
>
>Now, our tester complained that the Report Preview window is not saving the size anymore.
>
>I'm wondering what will be the easiest way to simulate saving last preview window size?
>
>Thanks a lot in advance.


You could create your own Preview Window and run the report inside that.
oPreviewForm = NEWOBJECT('PreviewForm')
REPORT FORM Rpt_ClientReviewWorksheetInternal IN WINDOW PreviewForm TO PRINTER PROMPT PREVIEW
oPreviewForm.Release
In my case, users want the report window to appear full screen so I just ZOOM MAX. But you could modify the FORM class to LOAD and SAVE the user's settings. Here's the class definition I use (which probably came from a sample posted on the UT long ago).
***********************************************************************
DEFINE CLASS PreviewForm AS FORM
***********************************************************************
Height = 250
Width = 375
Desktop = .F.
ShowWindow = 2
DoCreate = .T.
AutoCenter = .T.
BorderStyle = 3
Caption = "Print Preview Window"
ControlBox = .F.
Closable = .F.
MinButton = .F.
Movable = .F.
WindowType = 0
WindowState = 2
AlwaysOnTop = .F.
Name = "previewform"


***********************************************************************
PROCEDURE Deactivate
***********************************************************************
DODEFAULT()
IF WEXIST('Report Designer')
ZOOM WINDOW "Report Designer" MAX
* MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Report Designer"
ENDIF
IF WEXIST('Print Preview')
lnRow=MROW()
lnCol=MCOL()
MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"
*MOUSE AT lnRow,lnCol
ENDIF
***********************************************************************


***********************************************************************
PROCEDURE Init
***********************************************************************
DODEFAULT()
THIS.SHOW()
**  KEYBOARD 'L'   && WORKS!  75% is perfect
ENDPROC
***********************************************************************

***********************************************************************
PROCEDURE Activate
***********************************************************************
DODEFAULT()
IF WEXIST('Report Designer')
 *ZOOM WINDOW 'Report Designer' MAX
ENDIF
IF WEXIST('Print Preview')
 *ZOOM WINDOW 'Print Preview' MAX
 *MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"
 *DOCK WINDOW ("Print Preview") POSITION 0
ENDIF

ENDPROC
***********************************************************************


ENDDEFINE
***********************************************************************
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform