Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close Report Preview?
Message
 
 
To
07/06/2018 11:05:41
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01660616
Message ID:
01660634
Views:
48
>>>>>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?   
>>>>
>>>
>>>
>>>REPORT FORM TestReport TO PRINTER PROMPT PREVIEW NOWAIT 
>>>MESSAGEBOX("This message indicates that the report is being previewed; it is still open")
>>>Deactivate Window frxpreviewform
>>>Release Windows frxpreviewform
>>
>>What is the 'frxpreviewform' in your code? I tried your approach with my name RepName but it did't close the preview window.
>
>I have defined Shift-F11 to be ox=Sys(1270). So I move the mouse over the preview window, press Shift-F11 and get that ox.name = 'frxpreviewform''. Maybe it depends... Note that I have removed the "Name RepName" part, I don't know if that changes anything?

Yes, I removed NAME RepName from my code also. Now, that I see that Antonio's code works, but with the requirement for NOWAIT, I have to find to make the report work with NOWAIT. Since report depends on some Private variables, once the program moves ON, the variables are out of scope.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform