Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form desktop property and report viewers

Status
Not open for further replies.

EzLogic

Programmer
Aug 21, 2001
1,230
US
VFP9
SP2
Various OS systems on production machines.

I have an ERP application in VFP9 tons of forms, reports, etc..

One customer wanted the ability for the forms to be moved between monitors as he is using dual monitors. So, for my form base class, i made the Desktop=.t.

that works.

Now, when a report is being previewd on a machine with single monitor, the preview of the report is behind the form that invoked the report.

how to go about this obstacle?


Ali Koumaiha
TeknoSoft Inc.
Michigan
 
Well, Desktop Forms ar in front, minimize or hide them while doing the report would be my first stab at this.

You can also show the report in a form of your choice, you have the IN WINDOW clause of the report command.

Bye, Olaf.
 
I'm not sure about this, but instead of setting Desktop = .T. regardless, why not do so only when the dual monitors are active? That way, the application should run in exactly the same way when only a single monitor is present.

To find out if dual monitors are active, you could compare the figure returned by the Windows API GetSystemMetrics(78) function with that returned by VFP's SYSMETRIC(2).

The point is that the API function returns the virtual screen width (both monitors) whereas the other one returns the physical screen width. So you could do something like this:

Code:
DECLARE INTEGER GetSystemMetrics IN Win32API INTEGER
IF GetSystemMetrics(78) > SYSMETRIC(2)
  * Virtual screen is wider than physical screen,
  * so set the Desktop property
ELSE
  * Leave it alone
ENDIF

As I say, I'm not sure about this, and have no way of testing it, but it might be worth a try.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
It's true you can get the full width of two monitors in some way, I can dig that out in code I use to decide how to maximise. You can also maximise _screen to be on both monitors and thereby let users drag forms in both of them without Desktop = .T.

Bye, Olaf.
 
Now, when a report is being previewd on a machine with single monitor, the preview of the report is behind the form that invoked the report.

Which report writer? VFP9 has two of them and previews are handled WILDLY differently.
 
Dan,

its the native VFP9 report viewer.

Ali Koumaiha
TeknoSoft Inc.
Michigan
 
Ali,

instead of setting desktop = .t. try setting .showWindow = 2 (top level form).

hth

Nigel
 
i am going to try this faq

faq184-2490

will report back tomorrow

Ali Koumaiha
TeknoSoft Inc.
Michigan
 
Native VFP9 report writer" doesn't tell us anything. It has two of them.

REPORTBEHAVIOR 80 or 90? It really does make a material difference.
 
You are right dan. sorry.

behavior 8.0

Ali Koumaiha
TeknoSoft Inc.
Michigan
 
OK, the FAQ that you refer to applies.

One of the problems with REPORTBEHAVIOR 80 is that the report writer itself (which houses all previews) is a little stubborn about always being in the desktop window.

You *might* (or might not) have to fiddle with turning off the Resource file for report previews. That can muck things up.

But let us know how it goes!
 
Mike Lewis

Code:
IF GetSystemMetrics(78) > SYSMETRIC(2)

Wouldn't it always be higher since one is the width and the other is the height. Did you mean SYSMETRIC(1)?




Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top