As I believe I mentioned in an earlier thread, I wanted to have a VFP9
report preview that was zoomed by default. For a while, I used the
code from Cathy Pountney's "Report Writer in Action" article, but I
just discovered that makes the ReportListener's OnPreviewClose()
method fail to report that the report had been printed, as the
container didn't close when the print button was hit. After surfing
the docs a bit, I realized that an Extension Handler, as documented in
"Leveraging the Default Preview Container", would do the trick.
LPARAMETERS tcReport
DO (_REPORTPREVIEW) WITH loPC
loPC.Caption = tcCaption
loPC.ZoomLevel = 5 && 100% (default)
loPC.ToolbarIsVisible = .T.
loXH = NEWOBJECT("RLExtHandler")
loPC.SetExtensionHandler(loXH)
loRL = NEWOBJECT("ReportListener")
loRL.PreviewContainer = loPC
REPORT FORM "&tcReport." ;
TO PRINTER PROMPT ;
OBJECT loRL
DEFINE CLASS RLExtHandler AS Custom
PROCEDURE Show(iStyle)
WITH This.PreviewForm
.WindowState = 2
.Toolbar.Dock(0)
ENDWITH
ENDPROC
ENDDEFINE
_______________________________________________
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/[email protected]
** 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.