There are two things about that code I would consider changing.
Since there have been reported problems of returning from a method in a
WITH/ENDWITH, I don't like the .Release(). It may result in a similar C5 as
returning from the WITH/ENDWITH scenario does. Move it outside with
oForm.Release()
The other issue is a grey window behind the report preview window.
You could replace
.WindowState = 2
.Show()
With
ZOOM WINDOW (.Name) MAX
Tracy
-----Original Message-----
From: MB Software Solutions General Account
Sent: Friday, January 16, 2009 1:38 PM
On Fri, January 16, 2009 12:24 pm, Ken Dibble wrote:
> Hey Cathy, are you out there?
>
>
> I've been trying to avoid having to create my own preview window...
> just didn't want to have to put in the time when the native one is
> supposed to work.
So don't roll your own...use someone else's!!!! Here's the code I've got in
my main.prg which gets called from various areas in the exe:
FUNCTION ShowReport(tcRpt as String, tcCaption as String)
* mjb 01-24-05 using Fred Taylor's idea for showing report inside max window
(courtesy ProFox archives)
LOCAL loFrm
loFrm = CREATEOBJECT("Form")
WITH loFrm
.Caption = tcCaption
.WindowState = 2 && Maximized
.Show()
REPORT FORM (tcRpt) TO PRINTER PROMPT NOCONSOLE PREVIEW
WINDOW (.Name)
.Release()
ENDWITH && loFrm
ENDFUNC && ShowReport(tcRpt as String, tcCaption as String)
That's an older version. I've updated it somewhat (but don't have that
source at hand right now) where I pass the cursor name, whether to close it
after running the report, etc.
_______________________________________________
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/000701c9780a$8e33df20$aa9b9d...@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.