Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to know if FoxyPreviewer is active or not?

How to know if FoxyPreviewer is active or not?

How to know if FoxyPreviewer is active or not?

Hi Friends,

How do we check if FoxyPreviewer is active or not?

I.e., if I have already issued the command 'DO FoxyPreviewer.app' somewhere earlier in the code. My requirement is that I activate it before my call to REPORT FORM... and after the print I need to turn it off. I know I can do that by 'DO FoxyPreviewer.app WITH "Release".

However, I want to check in my code whether FoxyPreviewer is already active and if yes, I will not disturb that enviro when I return from my code. How do we achieve that ?

Thanks in advance,

RE: How to know if FoxyPreviewer is active or not?

Hi Rajesh,

Are you sure you need to activate FoxyPreviewer every time you run a report, and then de-activate it afterwards? Most of the time, you can just DO FoxyPreviewer.app at the start of the session, and release it when you are ready to quit.

If you want to temporarily switch it off (for example, if you want to run some of your reports without FoxyPreviewer), you can SET REPORTBEHAVIOR 80 to disable it, and then SET REPORTBEHAVIOR 90 to re-enable it.


Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: How to know if FoxyPreviewer is active or not?

Hi Mike,

Hope you and family keep fine! Thanks for your immediate response.

Yes, I can switch it on once at start up. But, my requirement is different. If I write a code for my client on a single module, chances are there the Calling Program (which might have written by someone else and I have not seen it) might have activated FoxyPreviewer within it before the call. Too, it may expect FoxyPreviewer to be still active after my code returns. In such a case, I would not want to (rather I should not) deactivate it from my code (for obvious reasons) which could break the Calling Program. But for that I need to check FoxyPreviewer status. But, how?

Now, as per your suggestion, it seems there is this alternative of setting the REPORTBEHAVIOR 80 instead of worrying about the FoxyPreviewer status (whether it's active or not at the moment). Am I on the right track ?


EDIT: I just checked it. When I do 'DO foxypreviewer.app', the REPORTBEHAVIOR turns 90 automatically. When I do 'DO foxypreviewer.app WITH "Release", the REPORTBEHAVIOR turns back to 80 automatically unconditionally. Even if my earlier status was REPORTBEHAVIOR 90, it becomes 80. So, I can check REPORTBEHAVIOR status it seems. Let me see..

Thank you Mike!

RE: How to know if FoxyPreviewer is active or not?

Well, foxypreviwer establishes an object _Screen.oFoxyPreviewer

That's how you detect it's running and in that case you might rely on it being preconfigured as the customer or the third party developer needs or wants it, use it as is, and don't release it.

When you look into the documentation you find this object mentioned and in "advanced" use you can use intellisense on this object in your own programming to set some features in this object. If you don't know it you miss out a lot of options.


RE: How to know if FoxyPreviewer is active or not?


Thank you very much!
Yes, this is exactly what I am looking for!

I have read about _Screen.oFoxyPreviewer but as I am not really using most of its features (other than PDF, HTML outputs etc), this object was not in my mind. Now, I really need to use them, say, taking off a few buttons from the toolbar, activating PDF in 'Save File As' menu etc etc. So, I will certainly try to check this.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close