Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Was The Report Run or Abandoned?
Message
From
16/10/2001 04:17:09
 
 
To
16/10/2001 03:14:16
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00568881
Message ID:
00568888
Views:
24
This message has been marked as a message which has helped to the initial question of the thread.
Gary,

The following is a bit of a hack but it should work. The idea is to add a variable to the report which calls a function. The function checks for EOF() and for the presence of the "Printing..." window to determine whether the report was completely run and whether the output was sent to the printer or not. The method stores the result into memvars that must be in scope.
Something like this:
PROCEDURE WasPrinted
*-- determines whether a report was run and whether the report
*-- was sent to the printer or not.

*-- The following memvars must be in scope:
*-- glReportWasRun: .T. if report was printed/previewed until last page
*-- glToPrinter: .T. if sent to printer

*-- add a variable to report which calls this procedure
*-- Value to store: WasPrinted()
*-- Initial value: WasPrinted()
*-- Release after report: No

IF VARTYPE(glReportWasRun) = "L"
	IF EMPTY(TAG())
		*-- there's a tag so we cannot use EOF()
		SKIP
		IF EOF()
			glReportWasRun = .t.
		ENDIF
		SKIP -1
	ELSE
		glReportWasRun = EOF()
	ENDIF
	
	IF VARTYPE(glToPrinter) = "L"

		glToPrinter = WVISIBLE("Printing...")
		
	ENDIF
ENDIF
>Friends:
>
>If I process a REPORT FORM TO PRINTER PROMPT, is there any way I can tell whether the user abandoned the print job? I tried to set _PAGENO to 0 (Zero) with the thought of testing for the number of pages after the REPORT FROM statement but, VFP complained in the program that this was an illegal value.
>
>The same question holds true of PREVIEWing a report. Is there any way to tell whether the user just shut down the preview without printing the report?
>
>Any help would be appreciated.
Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform