* *** old * *** dimension THIS.zoomLevels[10,3] * *** new dimension THIS.zoomLevels[11,3] * *** ... THIS.zoomLevels[10,ZOOM_LEVEL_PROMPT] = "Custom" THIS.zoomLevels[11,ZOOM_LEVEL_PROMPT] = ZOOM_LEVEL_PROMPT_WHOLE_PAGE_LOC * *** ... THIS.zoomLevels[10,ZOOM_LEVEL_PERCENT] = 5 && or any predifined zoom value THIS.zoomLevels[11,ZOOM_LEVEL_PERCENT] = -1 * *** ... THIS.zoomLevels[10,ZOOM_LEVEL_CANVAS] = 1 THIS.zoomLevels[11,ZOOM_LEVEL_CANVAS] = 1recomile the project as an app to the vfp folder.
olistener = NEWOBJECT("XMLListener", HOME(0)+"ffc\_reportlistener.vcx") olistener.ListenerType=1 REPORT form "c:\program files\microsoft visual foxpro 9\samples\solution\reports\colors.frx" ; OBJECT olistener nowait * *** to change to the new custom zoom olistener.PreviewContainer.oForm.zoomLevels(10,2) = 25 * *** actionSetZoom() will only update/recalculate if the para passed is different * *** then last time it was called. this could easely be changed in actionSetZoom() olistener.PreviewContainer.oForm.actionSetZoom( 10 )>Folks, I'm not going to waste a lot of time explaining this in text. It should be pretty self-evident.
>#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 >