There is no simple magical way to retrofit an app with multiple print
preview commands. Most options have to do with putting code before each call
to run the report. Here's an excerpt from my book.
Cathy
----
Maximize the Print Preview window
As seen in Figure 1 at the beginning of this chapter, the Print Preview
window does not come
up maximized. The first thing a user is going to do is maximize the window.
If you have a
read/write resource file in use during the execution of your application,
the user's change to
the window is recorded so the next time the user runs the same report, the
window appears
maximized. If you really want to be a hero, you could always run the report,
maximize it, and
then include your resource file with the application so the user doesn't
have to maximize each
report the first time each one is run.
However, if you don't have a read/write resource file in use during the
execution of your
application, you can use the KEYBOARD command to fudge the key combination
that
maximizes a window. This is a lot easier than running each report in the
entire application.
Use the following code to call the report.
KEYBOARD '{CTRL+F10}'
REPORT FORM MyReport PREVIEW
The reason this trick doesn't work when a read/write resource file is in use
is because
Ctrl-F10 is a toggle that switches between maximizing the window and
restoring the window.
The first time the user runs the report, the KEYBOARD command does as you
expected and
maximizes the window. However, the maximized state of the window gets saved
in the
resource file. The next time the user runs the report, it automatically
comes up maximized so
when the KEYBOARD command is executed, it ends up restoring the normal size
of the
window instead of maximizing as you intended.
Another method you can use to force the Print Preview window to maximize is
to use the
following line of code in the Init method of the Data Environment of the
report.
ZOOM WINDOW "Report Designer" MAX
Of course, this means you have to put this same line of code in every report
you write.
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
On
> Behalf Of Garrett Fitzgerald
> Sent: Saturday, December 19, 2009 3:10 PM
> To: [email protected]
> Subject: VFP9 printing - maximize windows automatically
>
> I've read the examples for how to pass a maximized preview container
> to the reportlistener to produce a fullscreen, appropriately-zoomed
> report. However, I can't remember if there's any way to do this for a
> legacy application, that has lots of print preview statements I'd just
> as soon not completely rewrite. Am I SOL here, or has one the the
> reporting geniuses out there come up with a fiendishly clever hack to
> save me work? :-)
>
> (And yes, I know I _should_ know this, considering I was contracting
> for the test team at the time, but I'm a bit rusty.)
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/003601ca8252$197a1200$4c6e36...@com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.