Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simulating FoxUser behavior
Message
From
17/05/2011 15:11:58
 
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:
01510903
Views:
70
>Guy,
>
>I was thinking along these lines also, but here is the deal.
>
>For all reports we're using a special form class. This class has PrintReport method. The class also has buttons such as Preview, etc. The preview button calls this method with the 'Preview' parameter
>
>Now, each report has the following code in its PrintPreview method
>
>report form ThisParticularReport &tcDestination
>
>I'm wondering how can I incorporate your idea so I don't have to change all the individual report forms (actual forms) and only fix the base class?
>

Seems you would just need to modify the tcDestination param if it is Preview to Preview in Window MyPreviewWindow



>
>
>>>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
>>***********************************************************************
>>


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Previous
Reply
Map
View

Click here to load this message in the networking platform