>CREATE CURSOR x (onefield l) > >* We can't CREATE report simplenodata from x >* It has to have a group, >* so you already have it. >* It should have remove line if blank turned on, etc > >SELECT x > >REPORT FORM (simplenodata) OBJECT ; > (NEWOBJECT("reportListenerEvenIfNoData")) ; > PREVIEW > >DEFINE CLASS reportListenerEvenIfNoData ; > AS ReportListener > > drivingAlias = "" > tempAlias = "" > isInGroupBand = .F. > isEmptyReport = .F. > > PROCEDURE LoadReport() > IF THIS.CommandClauses.Preview > THIS.ListenerType = 1 > ELSE > * you decide what you want for > * various clauses... > * you could also do this by > * creating the object reference before > * the REPORT FORM command of course > ENDIF > THIS.drivingAlias = ALIAS() > IF RECCOUNT() = 0 > WAIT WINDOW ; > "Report proxy cursor..." NOWAIT > THIS.tempAlias = "A" + SYS(2015) > SELECT * FROM (THIS.drivingAlias) ; > INTO CURSOR (THIS.tempAlias) READWRITE > SELECT (THIS.tempAlias) > APPEND BLANK > THIS.isEmptyReport = .T. > ELSE > THIS.isEmptyReport = .F. > ENDIF > ENDPROC > > PROCEDURE UnloadReport() > IF NOT ALIAS() == THIS.drivingAlias > SELECT (THIS.drivingAlias) > USE IN (THIS.tempAlias) > ENDIF > ENDPROC > > PROCEDURE BeforeBand(nBandObjCode, nFRXRecNo) > #define FRX_OBJCOD_GROUPHEADER 3 > #define FRX_OBJCOD_GROUPFOOTER 5 > THIS.IsInGroupBand = THIS.IsEmptyReport AND ; > INLIST(nBandObjCode,; > FRX_OBJCOD_GROUPHEADER,; > FRX_OBJCOD_GROUPFOOTER) > DODEFAULT(nBandObjCode,nFrxRecNo) > ENDPROC > > PROCEDURE AfterBand(nBandObjCode, nFRXRecNo) > THIS.isInGroupBand = .F. > DODEFAULT(nBandObjCode,nFrxRecNo) > ENDPROC > > PROCEDURE EvaluateContents(nFRXRecno,oProps) > IF THIS.isInGroupBand > oProps.Text = "" > oProps.Reload = .T. > ENDIF > ENDPROC > > * do something similar to the above for shapes > * with AdjustObjectSize() if you use shapes > * in the group bands... have not tested, > * but it should should work > > PROCEDURE Render(; > nFRXRecno, nLeft, nTop, nWidth, ; > nHeight, nObjectContinuationType, ; > cContentsToBeRendered, ; > GDIPlusImage) > * You probably don't need to do this > * if you're also doing the > * EvaluateContents stuff, > * but you *can* do it this way -- > * and it's a heck of a lot easier than a > * set of Print Whens. > * It will cover *all* object types > * (shapes, images, etc). > * However it will not close up space, > * you would need > * to do that with EvaluateContents > * and AdjustObjectSize, > * which occur earlier. > IF THIS.isInGroupBand > NODEFAULT > ELSE > DODEFAULT(nFRXRecno, ; > nLeft, nTop, nWidth, nHeight, ; > nObjectContinuationType, ; > cContentsToBeRendered, ; > GDIPlusImage ) > ENDIF > ENDPROC > >ENDDEFINE > >