LPARAMETERS; tlPrint *FYI: #DEFINE dcPrintWindow_uk 'Printing...' #DEFINE dcPrintWindow_deu 'Drucken...' LOCAL; lnEvents AS INTEGER,; lnEvent AS INTEGER,; llEvent AS BOOLEAN LOCAL ARRAY; laAvents(1,3) lnEvents = AEVENTS(laEvents,THIS) FOR lnEvent = 1 TO lnEvents IF laEvents(lnEvent,1) AND LOWER(laEvents(lnEvent,4))=('reportend') THEN llEvent = True EXIT ENDIF &&laEvents(lnEvent,1) AND LOWER(laEvents(lnEvent,4))=('reportend') ENDFOR &&lnEvent IF llEvent THEN IF !EMPTY(AEVENTS(laEvents,0)) THEN *supress VFP 8 style call from frx, if the summary band still holds the call DO CASE CASE !laEvents(1,1).BASECLASS='Reportlistener' CASE LOWER(laEvents(1,2))=('cancelreport') THIS.glPrinted = False CASE LOWER(laEvents(1,2))=('onpreviewclose') AND !tlPrint THIS.glPrinted = False ENDCASE ENDIF &&!EMPTY(AEVENTS(laEvents,0)) ELSE &&llEvent *this is for REPORTBEHAVIOR 80 and needs a call to this method in summary band THIS.glPrinted = ; WEXIST(dcPrintWindow_Deu) OR; WEXIST(dcPrintWindow_Uk) ENDIF &&llEventI call the report from a form like:
toListener = .NULL. DO (_REPORTOUTPUT) WITH tnListenerType,toListener THIS.glPrinted = .T. BINDEVENT(toListener,'CancelReport' ,THIS,'ReportEnd',1) BINDEVENT(toListener,'OnPreviewClose',THIS,'ReportEnd',1) REPORT FORM myReport OBJECT toListener UNBINDEVENTS(toListener,'OnPreviewClose',THIS,'ReportEnd') UNBINDEVENTS(toListener,'CancelReport' ,THIS,'ReportEnd') *If THIS.glPrinted is false, the report was not send to any spoolerHTH