I have a report that I used a reportlistener on to get my graphics sized and positioned properly. I need this report to be saved as an HTML. The code I tried was this:
vfile = FULLPATH("")+SYS(2015)+".html"
oSystem = CREATEOBJECT("gdisystems")
DO reportoutput.app WITH 5,oSystem
oSystem.targetfilename = vfile
osystem.quietmode = .T.
REPORT FORM eventscal OBJECT oSystem
********************************************************************************
DEFINE CLASS gdiSystems as _reportlistener OF _reportlistener.vcx
ogfx = NULL
lo_pen = NULL
oColor = NULL
obrush = NULL
barheight = 200 && Change this to the desired height for all bar s drawn
FUNCTION BeforeReport
DODEFAULT()
this.ogfx = CREATEOBJECT("gpgraphics")
ENDFUNC
FUNCTION BeforeBand(nBandObjCode,nFRXRecNo)
this.sharedGdiplusGraphics = this.GDIPlusGraphics
this.ogfx.sethandle(this.sharedGdiplusGraphics)
DODEFAULT(nBandObjCode,nFRXRecNo)
ENDFUNC
PROCEDURE Render
LPARAMETERS nFRXRecNo,nLeft,nTop,nWidth,nHeight,;
nObjectContinuationType,cContentsToBeRendered,GDIPlusImage
LOCAL oflds,vboxnum
***********************************************
** If the width is more than 1 day, subtract 8
** times the number of days from the width.
***********************************************
oflds = this.GetRec(nFRXRecNo)
IF AT("DAYBOX",oflds.user) != 0
this.lo_pen = NULL
this.oColor = NULL
this.obrush = NULL
vboxnum = INT(VAL(RIGHT(ALLTRIM(oflds.user),1)))
vday = "daylist.day"+ALLTRIM(STR(vboxnum))
GO TOP IN eventloc
DO WHILE !EOF("eventloc")
IF eventloc.dowstart = vboxnum AND &vday = DAY(eventloc.startdate) AND eventloc.daylistid = daylist.idnum
this.ocolor = CREATEOBJECT("gpcolor")
DO CASE
CASE eventloc.eventnum = 1
this.ocolor.foxrgb = RGB(0,0,255)
CASE eventloc.eventnum = 2
this.ocolor.foxrgb = RGB(0,255,0)
CASE eventloc.eventnum = 3
this.ocolor.foxrgb = RGB(255,0,0)
CASE eventloc.eventnum = 4
this.ocolor.foxrgb = RGB(255,0,255)
CASE eventloc.eventnum = 5
this.ocolor.foxrgb = RGB(255,255,0)
CASE eventloc.eventnum = 6
this.ocolor.foxrgb = RGB(0,255,255)
ENDCASE
this.lo_pen = CREATEOBJECT("gppen")
this.lo_pen.create(this.ocolor,2,2)
this.obrush = CREATEOBJECT("gpsolidbrush",this.ocolor)
vtop = (nTop+250) + (eventloc.eventnum-1)*this.barheight
this.ogfx.drawrectangle(this.lo_pen,nLeft,vtop,(nWidth*eventloc.eventlngth)-(8*(eventloc.eventlngth-1)),this.barheight)
this.ogfx.fillrectangle(this.obrush,nLeft,vtop,(nWidth*eventloc.eventlngth)-(8*(eventloc.eventlngth-1)),this.barheight)
ENDIF
SKIP IN eventloc
ENDDO
ENDIF
ENDPROC
PROCEDURE GetRec
LPARAMETERS FrxRec
LOCAL vsession,oret
vsession = SET("datasession")
SET DATASESSION TO this.frxdatasession
GO FrxRec IN FRX
SCATTER NAME oret memo
SET DATASESSION TO vsession
RETURN oret
ENDPROC
ENDDEFINE
this code gives me an HTNL file without the graphics I need. If I replace:
vfile = FULLPATH("")+SYS(2015)+".html"
oSystem = CREATEOBJECT("gdisystems")
DO reportoutput.app WITH 5,oSystem
oSystem.targetfilename = vfile
osystem.quietmode = .T.
REPORT FORM eventscal OBJECT oSystem
With:
oSystem = CREATEOBJECT("gdisystems")
REPORT FORM eventscal OBJECT oSystem PREVIEW
I get my HTML file but not with my graphics that I need.
Can someone help me with this
Thanks.