Firstly, thanks to all who have contributed to this topic (I'm constantly
amazed by the ingenuity of VFP developers). Stephen, your situation is the
same as mine, however, in my framework I've solved it a different way.

I have a custom command button (cmdPrint) which does a great deal of work
to handle report output. I've added a custom property (lPrinted). The click
event (method) code has this:
IF THIS.BeforeClick()
THIS.OnClick()
THIS.AfterClick()
ENDIF
In the OnClick method I have this (plus a lot more):
*!* Create a report listener based on _reportlistener of
_reportlistener.vcx loListener = NEWOBJECT("EffectsListener",
"dynamicformatting.prg") *!* Tell the listener what created it
loListener.oCaller = THIS loListener.OutputType = 1
THIS.ListenerProperties(loListener) && Set any other properties required
REPORT FORM (lcReport) TO PRINTER PROMPT PREVIEW OBJECT loListener *!* The
listener sets THIS.lPrinted in its OnPreviewClose method IF THIS.lPrinted
_VFP.StatusBar = "Report sent to printer." ELSE _VFP.StatusBar = "Report
preview only." ENDIF
The listener has this code in its OnPreviewClose method:
LPARAMETERS lPrint IF VARTYPE(THIS.oCaller) == "O" AND NOT
ISNULL(THIS.oCaller) THIS.oCaller.lPrinted = m.lPrint ENDIF
Finally, cmdPrint.AfterClick() takes any action required.

Once again, thanks to all.
Laurie


On 24 April 2015 at 21:20, Stephen Weeks <[email protected]> wrote:

> Laurie,
>
> I have to do this same thing for example users can preview an invoice
> before printing but I don't want to update the invoice master tagging it
> as printed at this stage, so I put the 'Preview' checkbox next to the
> "Print Invoice" button so I csn establish if the invoice was printed or
> previewed !
>
> Is this the sort of thing you are after ?
>
> On Fri, 24 Apr 2015, at 02:18 PM, Laurie Alvey wrote:
> > I've had a look at SYS(2040) but can't see how to use it. Calling it
> > after
> > the report always results in "0", and calling a form method in the page
> > footoer doesn't work.
> > Puzzled.
> > Laurie
> >
> > On 24 April 2015 at 13:33, Stephen Weeks <[email protected]>
> > wrote:
> >
> > > Sorry I am not having a good day :-
> > >
> > > if thisform.check1.value=.t.
> > >  report form myreport preview
> > >  WasPrinted=.f. && as this is a preview
> > > else
> > >  report form myreport to printer prompt noconsole
> > >  WasPrinted=.t.
> > > endif
> > >
> > > On Fri, 24 Apr 2015, at 01:31 PM, Stephen Weeks wrote:
> > > > Sorry this got cut short
> > > >
> > > > if thisform.check1.value=.t.
> > > >  report form myreport preview
> > > >  WasPrinted=.t.
> > > > else
> > > >  report form myreport to printer prompt noconsole
> > > >  WasPrinted=.f.
> > > > endif
> > > >
> > > > On Fri, 24 Apr 2015, at 01:29 PM, Stephen Weeks wrote:
> > > > > I tend to put a checkbox "Preview" which the user ticks if only to
> > > > > preview the report, this enabled me to carry out certain actions
> if the
> > > > > rteport is actually printed , which I believe is what you want :-
> > > > >
> > > > > if thisform.check1.value=.t.
> > > > >
> > > > > else
> > > > >
> > > > > endif
> > > > >
> > > > > On Fri, 24 Apr 2015, at 11:06 AM, Laurie Alvey wrote:
> > > > > > When printing a report, I usually issue something like this:
> > > > > > REPORT FORM <myreport> TO PRINTER PROMPT PREVIEW
> > > > > >
> > > > > > What I want to do is receive some sort of notification as to
> whether
> > > the
> > > > > > report was actually sent to the printer or just previewed. Does
> > > anyone
> > > > > > have
> > > > > > any ideas? (I've looked at vfp2c32 but it looks horribly
> complicated
> > > and
> > > > > > I'm not sure it will do what I want.)
> > > > > >
> > > > > > Laurie
> > > > > >
> > > > > >
> > > > > > --- StripMime Report -- processed MIME parts ---
> > > > > > multipart/alternative
> > > > > >   text/plain (text body -- kept)
> > > > > >   text/html
> > > > > > ---
> > > > > >
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/camvtr9creourumqymabgyw5uu0fhztyq3axyhh-nn6sggxg...@mail.gmail.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.

Reply via email to