>#DEFINE BASEPAGEHEIGHT 550 >#DEFINE BASEPAGEWIDTH 425 > >CLEAR ALL > >ox = NEWOBJECT("rl") >oy = CREATEOBJECT("form") > >WITH oy > .ScaleMode = 3 > .allowOutput = .F. > .top = 0 > .left = 0 > .height = BASEPAGEHEIGHT > .width = BASEPAGEWIDTH > .backcolor = RGB(255,255,255) > .Show() >ENDWITH > > >ox.PreviewContainer = oy > >REPORT FORM ? OBJECT ox > >ox.DoOutputPage(1,1) && 1 corresponds to 100% > >WAIT window > >ox.DoOutputPage(2, .21123 ) && that's, let's see <g> 21.123% > >WAIT window > >ox.DoOutputPage(3,2.367) && 236.7% ? > >WAIT window > > >DEFINE CLASS rl AS ReportListener > > ListenerType = 3 && like ListenerType 1, but > && the engine won't invoke preview; > && see release notes for more information > > PROCEDURE DoOutputPage(tPage, tMultiplier) > > LOCAL liPage > > IF VARTYPE(tPage) = "N" AND ; > BETWEEN(tPage,; > THIS.CommandClauses.RangeFrom, ; > IIF(THIS.CommandClauses.RangeTo=-1, ; > THIS.PageTotal, ; > THIS.CommandClauses.RangeTo)) > liPage = INT(tPage) > ELSE > liPage = THIS.CommandClauses.RangeFrom > ENDIF > > THIS.SetPreview(tMultiplier) > > THIS.OutputPage(liPage,ThIS.PreviewContainer.MyPreview,2) > > ENDPROC > > PROCEDURE SetPreview(tMultiplier) > > LOCAL liHeight, liWidth > > IF TYPE("THIS.PreviewContainer.MyPreview") # "O" > > THIS.PreviewContainer.AddObject("MyPreview","shape") > > ENDIF > > > IF VARTYPE(tMultiplier) = "N" AND ; > BETWEEN(tMultiplier,.01, 10) > > > liHeight = BASEPAGEHEIGHT * tMultiplier > liWidth = BASEPAGEWIDTH * tMultiplier > > WAIT WINDOW "H:" + TRANSFORM(liHeight)+ ; > ", W:" + TRANSFORM(liWidth) TIMEOUT 1 > > * note that Fox will round pixels > > WITH THIS.PreviewContainer > .LockScreen = .T. > .MyPreview.Height = liHeight > .MyPreview.Width = liWidth > .Height = liHeight > .Width = liWidth > .LockScreen = .F. > .Cls() > ENDWITH > > ENDIF > > ENDPROC > > PROCEDURE Destroy > THIS.PreviewContainer = NULL > ENDPROC > > >ENDDEFINE >