this code is copied straight from vfp 9.0 help files. i just added the two paramateres
this code works in vfp and when i run just the application on the computer that has vfp installed. however it is not working on non vfp computers. on a non vfp computer all i see is a wait window that says rendering and its tallying up the pages.
PARAMETERS REPNAME,ANGLE_OF_TILT
LOCAL oListener
oListener = CREATEOBJECT("rotateText")
oListener.ListenerType = 1
REPORT FORM &REPNAME OBJECT oListener
#define FRX_OBJCOD_PAGEHEADER 1
DEFINE CLASS rotateText AS ReportListener
IsInPageHeader = .F.
PROCEDURE Init()
DECLARE integer GdipRotateWorldTransform In GDIPlus.Dll ;
integer graphics,single angle,integer enumMatrixOrder_order
DECLARE integer GdipTranslateWorldTransform In GDIPlus.Dll ;
integer graphics,single dx,single dy,;
integer enumMatrixOrder_order
DECLARE integer GdipSaveGraphics IN GDIPlus.DLL ;
integer graphics, integer @xx
DECLARE integer GdipRestoreGraphics IN GDIPlus.DLL ;
integer graphics, integer xx
ENDPROC
PROCEDURE BeforeBand(nBandObjCode, nFRXRecNo)
DODEFAULT(nBandObjCode, nFRXRecNo)
IF (nBandObjCode = FRX_OBJCOD_PAGEHEADER)
THIS.IsInPageHeader = .T.
ENDIF
ENDPROC
PROCEDURE AfterBand(nBandObjCode, nFRXRecNo)
IF (nBandObjCode = FRX_OBJCOD_PAGEHEADER)
THIS.IsInPageHeader = .F.
ENDIF
DODEFAULT(nBandObjCode, nFRXRecNo)
ENDPROC
PROCEDURE Render(nFRXRecNo, nLeft, nTop, nWidth, nHeight,;
nObjectContinuationType, cContentsToBeRendered, GDIPlusImage)
LOCAL xx,x,y, z
xx = 0
IF THIS.IsInPageHeader
* get appropriate versions of coords
x = nLeft
y = nTop
* save the current state of the graphics handle
z = GdipSaveGraphics(this.GDIPlusGraphics, @xx)
* now move the 0,0 point to where we'd like it to be
* so that when we rotate we're rotating around the
* appropriate point
z = GdipTranslateWorldTransform(this.GDIPlusGraphics,x,y,0)
* should check z here -- will be 0 if no error occurred
* now change the angle at which the draw will occur
z = GdipRotateWorldTransform ( this.GDIPlusGraphics,ANGLE_OF_TILT,0)
* should check z as above
* restore the 0,0 point
z = GdipTranslateWorldTransform(this.GDIPlusGraphics,-x,-y, 0)
* should check z as above
ENDIF
* explicitly call the baseclass behavior
* when we are ready for it
DODEFAULT(nFRXRecNo, nLeft, nTop, nWidth, nHeight, ;
nObjectContinuationType, cContentsToBeRendered, ;
GDIPlusImage)
* put back the state of the graphics handle
IF THIS.IsInPageHeader
GdipRestoreGraphics(this.GDIPlusGraphics, xx)
ENDIF
* don't let the baseclass render
* when and how it would otherwise do it
NODEFAULT
ENDPROC
ENDDEFINE