Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Previewing a report
Message
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00965887
Message ID:
01425990
Views:
67
>>define class PreviewExtension as custom
>> procedure Show( iModal )
>> THIS.PreviewForm.WindowState = 2
>> THIS.PreviewForm.Toolbar.Dock(0)
>> endproc
>>
>> procedure AddBarsToMenu( cPop, iNext )
>> endproc
>>
>> procedure HandledKeyPress( nKey, nMod )
>> endproc
>>
>> procedure Paint()
>> endproc
>>
>> procedure Release()
>> endproc
>>enddefine
>>By default, the preview container will remember how you left the preview window for that report and restore the settings. But this should override that.
>>
>>The reason you can't get at the .WindowState property before actually running the report form is that the preview form doesn't exist yet. What you have in the m.PC variable is a reference to a proxy object, which among other things, handles figuring out what preview form class to instantiate in its .Show() method. (This wouldn't have been quite as necessary if it were possible to change properties like .Desktop, .TopForm, .WindowType, etc, on the fly.)
>>Alas, .SetWindowState() was not implemented in the PreviewProxy object.
>>
>>Perhaps you would like to set up the VFP environment so that your handler is always used? One way is to do the following:
>>
>>
*------------------------------------
>>* A Customised ReportPreview Factory.
>>* _REPORTPREVIEW = <this program>
>>*------------------------------------
>>lparameter pcRef
>>
>>do HOME()+"ReportPreview.App" with  pcRef
>>pcRef.SetExtensionHandler( newobject("PreviewExtension") )
>>return
>>
>>define class PreviewExtension as custom
>>    :
>>
>>
>>I hope this helps,
>>- Colin
>
>Hi Colin,
>
>This is the solution we're using here, but I noticed that ESC doesn't release the preview window. Do you know why is that and what should I change to fix it?
>
>Thanks again.

Placing code in HandledKeyPress seems to fix the problem, though the form is released somehow in 2 steps...

Any ideas anyone using this technique?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform