Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close Report Preview?
Message
From
07/06/2018 11:32:41
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01660616
Message ID:
01660636
Views:
56
>>>>Hi,
>>>>
>>>>(This thread is a change to the Form Created with Define Window thread). I found that Define Window is not a problem.
>>>>
>>>>The problem occurs when the program shows a report in Preview Mode, I need to find it (this preview window) and close it; programatically. As if the user actually clicked on the Exit icon of the Report Preview toolbar.
>>>>
>>>>Is this possible? How?
>>>>
>>>>TIA.
>>>
>>>This is a simple code of previewing a report:
>>>
>>>
>>>REPORT FORM TestReport TO PRINTER PROMPT PREVIEW NAME RepName NOWAIT 
>>>
>>>MESSAGEBOX("This message indicates that the report is being previewed; it is still open")
>>>
>>>*-- !!! Big question. How would you close the report preview here PROGRAMATICALLY?   
>>>
>>
>>Hi, Dmitry
>>
>>
>>RELEASE WINDOWS "Report Designer"
>>
>>
>>will release your preview window, but it must not be in modal state. That is, the NOWAIT is required (unless you turn into the 9.0 report engine - but I assume you don't want to do that).
>
>Antonio,
>
>What do you mean by "turn into the 9.0 report engine"? I missed that part in your message.

It will give much more control on the output, but at the expense of further coding (and you said you wanted to minimize the changes...).

The reason why the NOWAIT is required is because the preview window is normally modal, and it waits for a user action to proceed (to print or to close). Being modal, it does not react to your RELEASE WINDOWS code until it releases itself (when it is already too late).
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform